Android NDK sample build error linux

六眼飞鱼酱① 提交于 2020-02-25 10:16:06

问题


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:


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.



来源:https://stackoverflow.com/questions/21434819/android-ndk-sample-build-error-linux

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!