When compiling my android ndk project I have added
APP_STL := stlport_static
to my jni/Application.mk file which allows use of some STL stuff. however, when I clean and build I get an error libstlport_static.a: No such file: Permission denied I have found that a solution to this is to add
STLPORT_FORCE_REBUILD := true
This is a fix, but rebuilding the stlport library every time is obviously very time consuming. Is there a better fix to this problem?
You haven't said which platform you are developing on, but I'm going to guess that it is Windows.
If you're using Vista or Windows 7, then the issue may genuinely be a permissions problem with the libstlport_static.a file. Either check the permissions on the file or try disabling User Account Control altogether.
Note that there are three versions of libstlport_static.a provided in the NDK. You should be able to work out which one(s) your application is using by referring to the APP_ABI setting in your Application.mk file.
I solved this by changing the permissions of the source file. In that case:
chmod 777 <ndk-dir>/sources/cxx-stl/stlport/libs/armeabi/libstlport_satic.a
If you are using NDK r7c, another way (instead of turning off UAC) is call
ndk-build in Windows' command prompt (cmd) instead from bash under cygwin.
In NDK r7 and above,
ndk-build is no longer dependent on cygwin and therefore invoking it directly in cmd avoids the permission issue because tools now have the same permission as you. Note you still need cygwin if you want to debug your native code.