Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:\myApp\android\app\src\debug\AndroidManifest.xml:22:18-91 Error:
        Attribute application@appComponentFactory 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 application@appComponentFactory 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

like image 457
Frank Andrew Avatar asked Jun 18 '19 07:06

Frank Andrew


3 Answers

i had the same issue and changed version of gradle on android > build.gradle and fixed my problem

classpath("com.android.tools.build:gradle:4.2.2")

to

classpath("com.android.tools.build:gradle:7.1.1")

clean gradle and build again

in android directory command prompt:

#gradlew clean
#gradlew build
like image 85
Ahmad Avatar answered Sep 18 '22 12:09

Ahmad


So I faced this issue while installing react-native-reanimated in order to make react-navigation-drawer working.

The fix was:

  1. Add to android/gradle.properties:
android.enableJetifier=true
android.useAndroidX=true
  1. yarn add jetifier

  2. In android directory run: ./gradlew clean

  3. Run: yarn jetify

  4. react-native run-android

My RN version 0.59.8

like image 7
Maksym Koshyk Avatar answered Nov 06 '22 18:11

Maksym Koshyk


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

like image 4
ComicScrip Avatar answered Nov 06 '22 19:11

ComicScrip