Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execution failed for task ':app:mergeDebugNativeLibs'. #35215

Closed
AhmadAl-Ghalban opened this issue Nov 5, 2022 · 12 comments
Closed

Execution failed for task ':app:mergeDebugNativeLibs'. #35215

AhmadAl-Ghalban opened this issue Nov 5, 2022 · 12 comments
Labels
Resolution: Fixed A PR that fixes this issue has been merged.

Comments

@AhmadAl-Ghalban
Copy link

Description

FAILURE: Build failed with an exception.

  • What went wrong:
    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:
- C:\Users\aalga.gradle\caches\transforms-3\bcda05ca86467d746c65d57ddc70397c\transformed\jetified-react-native-0.71.0-rc.0-debug\jni
- C:\Users\aalga.gradle\caches\transforms-3\83386d0e15a386bf843831cc38d6223d\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

Version

0.65.2

Output of npx react-native info

OS: Windows 10 10.0.22000
CPU: (12) x64 Intel(R) Core(TM) i7-9750HF CPU @ 2.60GHz
Memory: 2.20 GB / 15.92 GB
Binaries:
Node: 16.15.1 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
npm: 8.16.0 - C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK:
API Levels: 23, 27, 28, 29, 30, 31, 33
Build Tools: 28.0.3, 29.0.2, 30.0.1, 30.0.2, 30.0.3, 31.0.0, 33.0.0
System Images: android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom
Android NDK: Not Found
Windows SDK: Not Found
IDEs:
Android Studio: AI-212.5712.43.2112.8609683
Visual Studio: 17.2.32630.192 (Visual Studio Community 2022)
Languages:
Java: 11.0.12 - C:\Program Files\Microsoft\jdk-11.0.12.7-hotspot\bin\javac.EXE
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.65.2 => 0.65.2
react-native-windows: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

Task :app:mergeDebugNativeLibs FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.2/userguide/command_line_interface.html#sec:command_line_warnings
724 actionable tasks: 724 executed
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\DaremeNew\Dareme\node_modules@react-native-async-storage\async-storage\android\src\main\java\com\reactnativecommunity\asyncstorage\AsyncStorageModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\DaremeNew\Dareme\node_modules@react-native-async-storage\async-storage\android\src\main\java\com\reactnativecommunity\asyncstorage\AsyncStoragePackage.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: D:\DaremeNew\Dareme\node_modules\react-native-background-timer\android\src\main\java\com\ocetnik\timer\BackgroundTimerModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\DaremeNew\Dareme\node_modules@react-native-community\checkbox\android\src\main\java\com\reactnativecommunity\checkbox\ReactCheckBoxEvent.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\DaremeNew\Dareme\node_modules@react-native-community\geolocation\android\src\main\java\com\reactnativecommunity\geolocation\GeolocationModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\DaremeNew\Dareme\node_modules\react-native-create-thumbnail\android\src\main\java\com\createthumbnail\CreateThumbnailModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\DaremeNew\Dareme\node_modules\react-native-create-thumbnail\android\src\main\java\com\createthumbnail\CreateThumbnailModule.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: D:\DaremeNew\Dareme\node_modules\react-native-document-picker\android\src\main\java\com\reactnativedocumentpicker\DocumentPickerModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\DaremeNew\Dareme\node_modules\react-native-fbsdk-next\android\src\main\java\com\facebook\reactnative\androidsdk\Utility.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\DaremeNew\Dareme\node_modules@react-native-google-signin\google-signin\android\src\main\java\com\reactnativegooglesignin\RNGoogleSigninModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\DaremeNew\Dareme\node_modules@react-native-google-signin\google-signin\android\src\main\java\com\reactnativegooglesignin\RNGoogleSigninModule.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\DaremeNew\Dareme\node_modules\react-native-localize\android\src\main\java\com\zoontek\rnlocalize\RNLocalizeModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\DaremeNew\Dareme\node_modules\react-native-nodemediaclient\android\src\main\java\cn\nodemedia\react_native_nodemediaclient\NodeCameraViewManager.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: D:\DaremeNew\Dareme\node_modules@react-native-firebase\auth\android\src\main\java\io\invertase\firebase\auth\ReactNativeFirebaseAuthModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: D:\DaremeNew\Dareme\node_modules@react-native-firebase\functions\android\src\main\java\io\invertase\firebase\functions\UniversalFirebaseFunctionsModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\DaremeNew\Dareme\node_modules@react-native-firebase\messaging\android\src\main\java\io\invertase\firebase\messaging\ReactNativeFirebaseMessagingModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\DaremeNew\Dareme\node_modules\react-native-push-notification\android\src\main\java\com\dieam\reactnativepushnotification\modules\RNPushNotification.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

  • What went wrong:
    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:
- C:\Users\aalga.gradle\caches\transforms-3\bcda05ca86467d746c65d57ddc70397c\transformed\jetified-react-native-0.71.0-rc.0-debug\jni
- C:\Users\aalga.gradle\caches\transforms-3\83386d0e15a386bf843831cc38d6223d\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

  • 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.

  • Get more help at https://help.gradle.org

BUILD FAILED in 4m 16s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\DaremeNew\Dareme\node_modules@react-native-async-storage\async-storage\android\src\main\java\com\reactnativecommunity\asyncstorage\AsyncStorageModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\DaremeNew\Dareme\node_modules@react-native-async-storage\async-storage\android\src\main\java\com\reactnativecommunity\asyncstorage\AsyncStoragePackage.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: D:\DaremeNew\Dareme\node_modules\react-native-background-timer\android\src\main\java\com\ocetnik\timer\BackgroundTimerModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\DaremeNew\Dareme\node_modules@react-native-community\checkbox\android\src\main\java\com\reactnativecommunity\checkbox\ReactCheckBoxEvent.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\DaremeNew\Dareme\node_modules@react-native-community\geolocation\android\src\main\java\com\reactnativecommunity\geolocation\GeolocationModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\DaremeNew\Dareme\node_modules\react-native-create-thumbnail\android\src\main\java\com\createthumbnail\CreateThumbnailModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\DaremeNew\Dareme\node_modules\react-native-create-thumbnail\android\src\main\java\com\createthumbnail\CreateThumbnailModule.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: D:\DaremeNew\Dareme\node_modules\react-native-document-picker\android\src\main\java\com\reactnativedocumentpicker\DocumentPickerModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\DaremeNew\Dareme\node_modules\react-native-fbsdk-next\android\src\main\java\com\facebook\reactnative\androidsdk\Utility.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\DaremeNew\Dareme\node_modules@react-native-google-signin\google-signin\android\src\main\java\com\reactnativegooglesignin\RNGoogleSigninModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\DaremeNew\Dareme\node_modules@react-native-google-signin\google-signin\android\src\main\java\com\reactnativegooglesignin\RNGoogleSigninModule.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\DaremeNew\Dareme\node_modules\react-native-localize\android\src\main\java\com\zoontek\rnlocalize\RNLocalizeModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\DaremeNew\Dareme\node_modules\react-native-nodemediaclient\android\src\main\java\cn\nodemedia\react_native_nodemediaclient\NodeCameraViewManager.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: D:\DaremeNew\Dareme\node_modules@react-native-firebase\auth\android\src\main\java\io\invertase\firebase\auth\ReactNativeFirebaseAuthModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: D:\DaremeNew\Dareme\node_modules@react-native-firebase\functions\android\src\main\java\io\invertase\firebase\functions\UniversalFirebaseFunctionsModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\DaremeNew\Dareme\node_modules@react-native-firebase\messaging\android\src\main\java\io\invertase\firebase\messaging\ReactNativeFirebaseMessagingModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\DaremeNew\Dareme\node_modules\react-native-push-notification\android\src\main\java\com\dieam\reactnativepushnotification\modules\RNPushNotification.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.
insights.

BUILD FAILED in 4m 16s
at makeError (D:\DaremeNew\Dareme\node_modules\execa\index.js:174:9)
at D:\DaremeNew\Dareme\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (D:\DaremeNew\Dareme\node_modules@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (D:\DaremeNew\Dareme\node_modules@react-native-community\cli\build\index.js:192:9)
info Run CLI with --verbose flag for more details.error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Snack, code example, screenshot, or link to a repository

when run app Return this error and Don't run

@codefromrvk
Copy link

You can check this fix.
#35210

@cortinico
Copy link
Contributor

Fix for this issue is here as suggested by @codefromrvk

@cortinico cortinico added Resolution: Fixed A PR that fixes this issue has been merged. and removed Needs: Triage 🔍 labels Nov 5, 2022
@hayder-nativapps
Copy link

add this to your app/build.gradle

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

@AhmadAl-Ghalban
Copy link
Author

I Found The Solution Just add this code in android/build.gradle
allprojects {
configurations.all {
resolutionStrategy {
force 'com.facebook.react:react-native:0.65.2' //select Version you used
}
}

@BobbySingle
Copy link

add this to your app/build.gradle

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

This worked to build the app, but the app crashed after the build

@anuchitIBC
Copy link

I Found The Solution Just add this code in android/build.gradle allprojects { configurations.all { resolutionStrategy { force 'com.facebook.react:react-native:0.65.2' //select Version you used } }

worked for me

@farooqalam20996
Copy link

I Found The Solution Just add this code in android/build.gradle allprojects { configurations.all { resolutionStrategy { force 'com.facebook.react:react-native:0.65.2' //select Version you used } }

Worked For me !..
Thanks

@phamtandat1997
Copy link

I Found The Solution Just add this code in android/build.gradle allprojects { configurations.all { resolutionStrategy { force 'com.facebook.react:react-native:0.65.2' //select Version you used } }

Worked For me !..

@dprajapati1179
Copy link

App crashes on start-up after adding this code I am using latest vesrion.

@Luizrebelatto
Copy link

I Found The Solution Just add this code in android/build.gradle allprojects { configurations.all { resolutionStrategy { force 'com.facebook.react:react-native:0.65.2' //select Version you used } }

thank you very much!! after 2 hours searching this solution solved my problem

@frannavg
Copy link

frannavg commented Nov 7, 2022

add this to your app/build.gradle

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

That one worked pretty well for me, tks

@cortinico
Copy link
Contributor

The fix for this issue is the one listed here:
#35210

Do not apply other patches like pickFirst which can cause runtime crashes.

@facebook facebook locked as resolved and limited conversation to collaborators Nov 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Fixed A PR that fixes this issue has been merged.
Projects
None yet
Development

No branches or pull requests