遇到错误怎么办:ndk-build.cmd‘‘ finished with non-zero exit value 2

Posted 柳鲲鹏

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了遇到错误怎么办:ndk-build.cmd‘‘ finished with non-zero exit value 2相关的知识,希望对你有一定的参考价值。

只要是so编译有问题,都是报这个错误。

  • 揭示错误
Execution failed for task ':libusb4javajni:ndkBuild'.
> Process 'command 'D:\\SOFTWARES\\DEVELOP\\android-ndk-r16b/ndk-build.cmd'' finished with non-zero exit value 2

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • 自行编译查看具体错误
D:\\Nanjing-SVN\\UsbCamera-BulkTransfer\\libusb4javajni\\src\\main\\jni\\libusb4java>D:
\\SOFTWARES\\DEVELOP\\android-ndk-r16b/ndk-build.cmd
Android NDK: WARNING: APP_PLATFORM android-14 is higher than android:minSdkVersi
on 1 in D:/Nanjing-SVN/UsbCamera-BulkTransfer/libusb4javajni/src/main/AndroidMan
ifest.xml. NDK binaries will *not* be comptible with devices older than android-
14. See https://android.googlesource.com/platform/ndk/+/master/docs/user/common_
problems.md for more information.
D:/SOFTWARES/DEVELOP/android-ndk-r16b/build//../build/core/setup-app.mk:81: Andr
oid NDK: Application targets deprecated ABI(s): armeabi
D:/SOFTWARES/DEVELOP/android-ndk-r16b/build//../build/core/setup-app.mk:82: Andr
oid NDK: Support for these ABIs will be removed in a future NDK release.
D:/Nanjing-SVN/UsbCamera-BulkTransfer/libusb4javajni/src/main/jni/Android.mk:7:
D:/Nanjing-SVN/UsbCamera-BulkTransfer/libusb4javajni/src/main/jni/libuvc/android
/jni/Android.mk: No such file or directory
D:/Nanjing-SVN/UsbCamera-BulkTransfer/libusb4javajni/src/main/jni/Android.mk:7:
D:/Nanjing-SVN/UsbCamera-BulkTransfer/libusb4javajni/src/main/jni/libuvc/android
/jni/Android.mk: No such file or directory
make: *** No rule to make target `D:/Nanjing-SVN/UsbCamera-BulkTransfer/libusb4j
avajni/src/main/jni/libuvc/android/jni/Android.mk'.  Stop.

想办法解决即可。

以上是关于遇到错误怎么办:ndk-build.cmd‘‘ finished with non-zero exit value 2的主要内容,如果未能解决你的问题,请参考以下文章

MAC下eclipse build项目的时候提示无法运行ndk-build.cmd

ndk-build.cmd‘‘ finished with non-zero exit value 2

Eclipse中NDK无法编译(哪怕是一个新建的空白项目)

NDKBuild 失败

android开发,怎么使用ndk编译成.so文件

安卓深入理解系统详解(35)