51工具盒子

依楼听风雨
笑看云卷云舒,淡观潮起潮落

Android编译报错:Process 'command 'D:\MyDevEnv\Android-SDK\ndk\25.1.8937393/ndk-build.cmd'' finished with non-zero exit value 2解决方法

问题描述 {#问题描述}

Android编译报错:Process 'command 'D:\MyDevEnv\Android-SDK\ndk\25.1.8937393/ndk-build.cmd'' finished with non-zero exit value 2,具体报错信息如下所示:

|-----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | 1 2 3 4 5 6 7 | Execution failed for task ':libUVCCamera:ndkBuild'. > Process 'command 'D:\MyDevEnv\Android-SDK\ndk\25.1.8937393/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. |

解决方法 {#解决方法}

经过多次尝试发现在NDK的版本为25.1.893739323.1.7779620不能编译通过,将NDK的版本降低至21.4.7075529可以编译通过。

另外较新版本的NDK不支持原来的ABI,需要将 libuvccamera\src\main\jni\Application.mk 文件中的APP_ABI改为如下配置:

|-----------|------------------------------------------| | 1 | APP_ABI := arm64-v8a armeabi-v7a |

因此遇到编译不通过的问题时,可以考虑试试降低NDK的版本和修改APP_ABI进行尝试。

赞(0)
未经允许不得转载:工具盒子 » Android编译报错:Process 'command 'D:\MyDevEnv\Android-SDK\ndk\25.1.8937393/ndk-build.cmd'' finished with non-zero exit value 2解决方法