0
votes

I have just run my application without any error but when I add some packages in react native and react-native run-android execute, I get the same error:

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 element at AndroidManifest.xml:6:5-27:19 to override.

What is wrong with it and how do I fix it?

Manifest File:

  package="com.officeyar">

    <uses-permission android:name="android.permission.INTERNET" />

    <application
      android:name=".MainApplication"
      android:label="@string/app_name"
      android:icon="@mipmap/ic_launcher"
      android:roundIcon="@mipmap/ic_launcher_round"
      android:allowBackup="false"
      android:theme="@style/AppTheme"
    >
      <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
        android:windowSoftInputMode="adjustResize">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
      </activity>
      <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />


    </application>

</manifest>

1
Hover your mouse on Refactor tab in Android Studio. Scroll to the bottom, find "Migrate to androidx..." option and click on it. Follow the conversion process. When conversion is done, clean and rebuild the project - Taseer
I did it but there is written that nothing to migrate in the project. - user3155267
Share your app-level Gradle file please - Taseer

1 Answers

0
votes
Manifest merger failed

Happens usually when you not completely checkout code from remote repository, make sure you check out fully the remote branch

Solution :

  1. Stash if you have any local changes and delete local branch
  2. Checkout remote branch again
  3. Again checkout remote branch and apply stash and try running build

Hope this can help