Home > database >  A failure occurred while executing com.android.build.gradle.internal.tasks.MergeNativeLibsTask$Merge
A failure occurred while executing com.android.build.gradle.internal.tasks.MergeNativeLibsTask$Merge

Time:11-06

My react native project build fails somehow because of this error:

Execution failed for task ':app:mergeDebugNativeLibs'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.MergeNativeLibsTask$MergeNativeLibsTaskWorkAction
   > 2 files found with path 'lib/arm64-v8a/libfbjni.so' from inputs:
      - C:\Users\Antonio\.gradle\caches\transforms-3\7cca348744e25f57fc2d9f871aa73c9a\transformed\jetified-react-native-0.71.0-rc.0-debug\jni\arm64-v8a\libfbjni.so
      - C:\Users\Antonio\.gradle\caches\transforms-3\08b0f5c7017bf081f79b63ea5b053dc0\transformed\jetified-fbjni-0.3.0\jni\arm64-v8a\libfbjni.so
     If you are using jniLibs and CMake IMPORTED targets, see
     https://developer.android.com/r/tools/jniLibs-vs-imported-targets

Anybody got a clue what could cause the build to fail? I haven't edited any build file and/or removed/installed/upgraded new packages thanks

CodePudding user response:

For me this worked (after reading Tony's link), my version of react was 0.66.0
Changed this file android\app\build.gradle

implementation "com.facebook.react:react-native: "  // From node_modules

to

implementation "com.facebook.react:react-native:0.66.0!!"  // From node_modules

CodePudding user response:

Same issue here. It's happen 12 hours ago and basically before that I didn't change anything in code.

Execution failed for task ':app:mergeDebugNativeLibs'.

A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction 2 files found with path 'lib/armeabi-v7a/libfbjni.so' from inputs: - /Users/erdalkilic/.gradle/caches/transforms-3/9774db1afd8a27209dd17f0d0ee82cc8/transformed/jetified-react-native-0.71.0-rc.0-debug/jni - /Users/erdalkilic/.gradle/caches/transforms-3/587226f58025f84b74ebb542f6c09f7b/transformed/jetified-fbjni-0.3.0/jni If you are using jniLibs and CMake IMPORTED targets, see https://developer.android.com/r/tools/jniLibs-vs-imported-targets

CodePudding user response:

Here's a workaround to fix this problem if you are not using latest version of react-native. https://github.com/facebook/react-native/issues/35210

  • Related