[Solved] How to fix Execution failed for task ‘:app:processDebugManifest’ in React Native?
I find an error when run the project, I try to look for many examples but fail all, this is the detail of error:
D:myAppandroidappsrcdebugAndroidManifest.xml:22:18-91 Error:
Attribute [email protected] value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:7:5-117 to override.
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
> Task :app:processDebugManifest FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute [email protected] value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:7:5-117 to override.
Please anyone help me to solve this problem.
Thanks
Solution #1:
I had some more libraries(other than deviceinfo) that depended on gcm so I used this to fix the issue: https://stackoverflow.com/a/56648987/8306924
Solution #2:
Upgrading ‘react-native-device-info’ to version 2.1.2 fixed the error for me.
See http://github.com/facebook/react-native/issues/25294#issuecomment-503024749
Solution #3:
So I faced this issue while installing react-native-reanimated
in order to make react-navigation-drawer
working.
The fix was:
- Add to android/gradle.properties:
android.enableJetifier=true
android.useAndroidX=true
-
yarn add jetifier
-
In android directory run:
./gradlew clean
-
Run:
yarn jetify
-
react-native run-android
My RN version 0.59.8
Solution #4:
finally found a solution after 2days and just added below two lines to android/build.gradle
googlePlayServicesVersion = “16.+”
firebaseVersion = “17.3.4”
Solution #5:
You just have to edit “gradle.properties” and add:
android.useAndroidX=true
android.enableJetifier=true
So you resolved the dependency conflicts between google and third party dependencies.