I was trying to go through the first sample exercise provided in Android NDK. I was trying to run the following command on cygwin
android update project –p
However, I am getting android: command not found error
.
I checked my PATH variables. It already had ANDROID_HOME
, ANDROID_HOME/platforms
, ANDROID_HOME/tools
, ANDROID_HOME/platform-tools
One thing that I noticed was that there is no application named android
in any of the folder. There is just an executable JAR file named android
. Is that OK , or , this is my mistake ?
My PATH value added on request
bin:/cygdrive/c/Program Files/Java/jdk1.7.0_03/bin:/cygdrive/c/Program Files/Java/jdk1.7.0_03/include:/cygdrive/c/Ant2/bin:/cygdrive/c/Android/android-sdk/tools:/cygdrive/c/Android/android-sdk/platform-tools:/cygdrive/c/android-ndk/android-ndk-r8b:/cygdrive/c/Program Files/Java/jdk1.7.0_03/lib:/cygdrive/c/Android/android-sdk/platforms:/cygdrive/c/Program Files/Java/jdk1.7.0_03/bin:/usr/lib/lapack
Can anyone predict what am I missing ?
Thanks :)
Open your Android Studio Preference (or "File->Settings") > Appearance & Behavior > System Settings > Android SDK. You can find the path to your SDK and NDK, which is in the same directory.
You'll need to point to your NDK in your eclipse by adding the path of ndk-build to Window > preferences > android > NDK. Right click on your project folder. Choose android tools -> add native support (the bottom one) and click finish. Now it will ask for a name for your .
Android Studio installs all versions of the NDK in the android-sdk /ndk/ directory. Each version is located in a subdirectory with the version number as its name.
use:
$ android.bat update project --path .
There are errors in your approach:
Supposing that you will fix this errors, the part that you are still missing is:
tools
directory in the root of your SDK directoryandroid update project –p . -t android-10
.dex
files, files for the Dalvik VMThis android ...
command is used to update the building setup to a particular path and target, after that you should have at least the minimum configuration to produce an apk if the source code is well written and organized.
If the application is only written in Java you only need to build the apk at this point, you can do this with an IDE like Eclipse or with ant
doing only ant debug
or ant release
from the root of your project.
If everything will be fine you will find the apk in your <project root>/bin
folder.
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