Reputation: 2896
when I am Trying to compile native C code like this:
:~/com.***.sample.ndk1$ ./ndk-build
Android NDK: Could not find platform files (headers and libraries)
Android NDK: Please run build/tools/build-platforms.sh to build the corresponding directory.
/com.***.sample.ndk1/build/core/init.mk:345: *** Android NDK: Aborting . Stop.
:~/com.***.sample.ndk1$ build/tools/build-platforms.sh
.: 39: Can't open build/tools/../core/ndk-common.sh
:~/com.***.sample.ndk1$
The above error is shows.
Could anyone answer to solve this problem?
Upvotes: 3
Views: 4023
Reputation: 1808
You have to add the Your NDK location directory to Your system PATH
variable:
let suppose your ndk is in /opt/android/android-ndk-r8b
folder, android sdk is in /opt/android/android-sdk
folder
so, you may add the following lines to your ~/.bash_profile
(at the end of file) :
export PATH=$PATH:/opt/android/android-ndk-r8b:/opt/android/android-sdk
in addition You can run the following commands:
chmod -R a+r /opt/android/android-ndk-r8b
chmod -R a+r /opt/android/android-sdk
Upvotes: 1