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?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With