1
votes

Hello I am new to Android and I am trying to build the hello-jni sample that is included in the NDK but I get the error below, any idea how to fix it?

15:57:10 ** Build of configuration Default for project HelloJni ** /media/Project/adt-bundle-linux-x86-20131030/adt-bundle-linux-x86-20131030/android-ndk-r9c/ndk-build all Android NDK: WARNING: APP_PLATFORM android-19 is larger than android:minSdkVersion 3 in ./AndroidManifest.xml [armeabi-v7a] Compile thumb : hello-jni <= hello-jni.c arm-linux-androideabi-gcc: error trying to exec '/media/Project/adt-bundle-linux-x86-20131030/adt-bundle-linux-x86-20131030/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/as': execv: Exec format error make: * [obj/local/armeabi-v7a/objs/hello-jni/hello-jni.o] Error 1

15:57:10 Build Finished (took 230ms)

This is what I am using:

  • Ubuntu 10.04.4
  • ADT bundle for linux (v22.3.0-887826)
  • NDK r9c

Thanks in advance

1
Are you on a 64-bit system? If so, you likely need the 32-bit compatibility package to run the toolchain. An "Exec format error" usually indicates you are trying to run a binary built for a different ABI from that of your system.Chris Stratton
I am not sure how to check if I have 32-bit or 64-bit but uname -m returned i686 which I think means 32-bit. I downloaded the following files from android developer site: adt-bundle-linux-x86-20131030.zip and android-ndk-r9c-linux-x86.tar.tar. I unpacked them on a windows machine before moving them over to my ubuntu VM because it is a bit slow, I hope that does not matter.dbostream

1 Answers

1
votes

The WARNING is correct, and should be ignored.

Regarding the gcc error, you probably have a problem with installation of NDK. How did you unpack it? Check

ls -l /media/Project/adt-bundle-linux-x86-20131030/adt-bundle-linux-x86-20131030/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/arm-linux-androideabi/bin/as

This should be a symbolic link to ../../bin/arm-linux-androideabi-as, and both should have executable permissions.