简体   繁体   English

Android NDK示例构建错误linux

[英]Android NDK sample build error linux

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? 您好,我是Android的新手,我正在尝试构建NDK中随附的hello-jni示例,但是出现以下错误,您知道如何解决吗?

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 **项目HelloJni的配置默认构建** / media / Project / adt-bundle-linux-x86-20131030 / adt-bundle-linux-x86-20131030 / android-ndk-r9c / ndk-build所有Android NDK:警告:./AndroidManifest.xml中的APP_PLATFORM android-19大于android:minSdkVersion 3 [armeabi-v7a]编译thumb:hello-jni <= hello-jni.c arm-linux-androideabi-gcc:error尝试执行'/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格式错误: * [ obj / local / armeabi-v7a / objs / hello-jni / hello-jni.o]错误1

15:57:10 Build Finished (took 230ms) 15:57:10构建完成(耗时230ms)

This is what I am using: 这就是我正在使用的:

  • Ubuntu 10.04.4 Ubuntu 10.04.4
  • ADT bundle for linux (v22.3.0-887826) 适用于Linux的ADT捆绑包(v22.3.0-887826)
  • NDK r9c NDK r9c

Thanks in advance 提前致谢

The WARNING is correct, and should be ignored. 警告是正确的,应该忽略。

Regarding the gcc error, you probably have a problem with installation of NDK. 关于gcc错误,您可能在安装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. 这应该是到../../bin/arm-linux-androideabi-as的符号链接,并且都应具有可执行权限。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM