简体   繁体   English

React Native:任务 ':app:mergeAlphaDebugNativeLibs' 执行失败

[英]React Native : Execution failed for task ':app:mergeAlphaDebugNativeLibs'

I am getting the following error and I am using React Native on Apple M1 chip and the react native version is 0.64.1我收到以下错误,我在 Apple M1 芯片上使用 React Native,而 React Native 版本是 0.64.1


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeAlphaDebugNativeLibs'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > More than one file was found with OS independent path 'lib/armeabi-v7a/libfbjni.so'. If you are using jniLibs and CMake IMPORTED targets, see https://developer.android.com/studio/preview/features#automatic_packaging_of_prebuilt_dependencies_used_by_cmake

Please help me resolve this issues.请帮我解决这个问题。

Tried add below code to the following file app/build.gradle, app was build successfully but it crashed.尝试将以下代码添加到以下文件 app/build.gradle,应用程序已成功构建但崩溃了。

android {
   // yout existing code
   packagingOptions {
        pickFirst '**/libc++_shared.so'
        pickFirst '**/libfbjni.so'
    }
}

this work for me.这对我有用。

add to exclusiveContent 'android/build.gradle':添加到 exclusiveContent 'android/build.gradle':

allprojects {
    repositories {
        exclusiveContent {
            // We get React Native's Android binaries exclusively through npm,
            // from a local Maven repo inside node_modules/react-native/.
            // (The use of exclusiveContent prevents looking elsewhere like Maven Central
            // and potentially getting a wrong version.)
            filter {
                includeGroup "com.facebook.react"
            }
            forRepository {
                maven {
                    url "$rootDir/../node_modules/react-native/android"
                }
            }
        }
  //....
  }
}

Remember run:记住运行:

cd android && ./gradlew clean

暂无
暂无

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

相关问题 任务 ':app:checkDebugDuplicateClasses' 执行失败。 反应原生 - Execution failed for task ':app:checkDebugDuplicateClasses'. React Native React Native-任务':app:installDebug'的执行失败 - React Native - Execution failed for task ':app:installDebug' 任务':app:processDebugResources'的执行失败 - React Native - Execution failed for task ':app:processDebugResources' - React Native (React Native):任务 ':app:generatePackageList' 执行失败 - (React Native): Execution failed for task ':app:generatePackageList' 反应本机:BeoNews应用程序运行Android执行任务':app:transformClassesWithJarMergingForDebug'失败 - React-native: BeoNews app run-android Execution failed for task ':app:transformClassesWithJarMergingForDebug' 任务 ':react-native-camera:generateGeneralDebugRFile' 执行失败。 并构建失败 - Execution failed for task ':react-native-camera:generateGeneralDebugRFile'. and Build Failed 运行 react-native run-android 时任务 ':app:transformClassesWithDexForDebug' 执行失败 - Execution failed for task ':app:transformClassesWithDexForDebug' when running react-native run-android 反应本机任务:应用程序:安装调试失败 - React Native Task :app:installDebug FAILED 任务':react-native-device-info:processReleaseResources'的执行失败 - Execution failed for task ':react-native-device-info:processReleaseResources' 任务':react-native-admob:verifyReleaseResources'的执行失败 - Execution failed for task ':react-native-admob:verifyReleaseResources'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM