javascript android APK 构建失败“发现多个文件与操作系统独立路径‘lib/arm64-v8a/libc++_shared.so’”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/47056698/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
android APK build failed "More than one file was found with OS independent path 'lib/arm64-v8a/libc++_shared.so'"
提问by Tom Schofield
Execution failed for task ':app:transformNativeLibsWithMergeJniLibsForDebug'. > More than one file was found with OS independent path 'lib/arm64-v8a/libc++_shared.so'
任务 ':app:transformNativeLibsWithMergeJniLibsForDebug' 执行失败。> 发现多个文件与操作系统无关的路径“lib/arm64-v8a/libc++_shared.so”
This happens when trying to build APK from this file https://github.com/node-on-mobile/node-on-android
尝试从此文件构建 APK 时会发生这种情况https://github.com/node-on-mobile/node-on-android
回答by Bernardo Rocha
Try adding this inside your build.gradle:
尝试将其添加到 build.gradle 中:
android {
...
packagingOptions {
exclude 'lib/arm64-v8a/libc++_shared.so'
}
}
回答by Sarpe
I had the same issue compiling the project, the solution I found is in two steps:
我在编译项目时遇到了同样的问题,我找到的解决方案分两步:
- Rename
jniLibs/arm64-v8a/libc++_shared.sotojniLibs/arm64-v8a/libc++node_shared.so Change line
401ofsrc/main/include/node/common.gypiinto'CLANG_CXX_LIBRARY': 'libc++node',
- 重命名
jniLibs/arm64-v8a/libc++_shared.so为jniLibs/arm64-v8a/libc++node_shared.so 改线
401的src/main/include/node/common.gypi成'CLANG_CXX_LIBRARY': 'libc++node',
There is also a repository issuewhere I'm going to suggest this solution.
还有一个存储库问题,我将在其中建议此解决方案。

