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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-29 07:09:33  来源:igfitidea点击:

android APK build failed "More than one file was found with OS independent path 'lib/arm64-v8a/libc++_shared.so'"

javascriptandroidnode.js

提问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.soto jniLibs/arm64-v8a/libc++node_shared.so
  • Change line 401of src/main/include/node/common.gypiinto

     'CLANG_CXX_LIBRARY': 'libc++node',
    
  • 重命名jniLibs/arm64-v8a/libc++_shared.sojniLibs/arm64-v8a/libc++node_shared.so
  • 改线401src/main/include/node/common.gypi

     'CLANG_CXX_LIBRARY': 'libc++node',
    

There is also a repository issuewhere I'm going to suggest this solution.

还有一个存储库问题,我将在其中建议此解决方案。