14

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

8 Answers 8

7

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

3
  • 1
    doesn't work for me been stuck on this for 2 days keeps showing > Task :app:processDebugMainManifest FAILED
    – Alohe
    Mar 7, 2022 at 6:09
  • Maybe something changed since then... Mar 8, 2022 at 13:54
  • 1
    setting the build tools version in build.gradle file to buildToolsVersion = "23.0.1" worked for me
    – Alohe
    Mar 9, 2022 at 15:05
4

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

0
3

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

3

finally found a solution after 2days and just added below two lines to android/build.gradle

googlePlayServicesVersion = "16.+"

firebaseVersion = "17.3.4"

1
  • 4
    where in the file would these go?
    – JeremyF
    Dec 21, 2019 at 3:18
2

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.

2

I downgraded java version from 17 to 15 and it works

0
2

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
1
  • after then, upgrade JAVA to 11 maybe help you go next: bash brew tap homebrew/cask-versions brew install --cask zulu11
    – microJ
    Jul 1, 2022 at 4:14
2

The solution to the Execution failed for task :app:processDebugMainManifest’ in React Native Android project for JDK 16, 17, and above is to add the following line in the ./android/gradle.properties file in your project:

org.gradle.jvmargs=--add-opens java.base/java.io=ALL-UNNAMED

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.