0
votes

I am getting the following error on compiling.

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:5:5-27:19 to override.

Can anyone please help me to fix it.

build.gradle

implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
//additional android libs
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
// third-party libs
implementation 'com.jakewharton:butterknife:10.1.0' // butter-knife
annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0' // butter-knife
implementation 'com.stepstone.stepper:material-stepper:4.3.1' // registration stepper

Manifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".RegisterTravelerActivity"></activity>
        <activity
            android:name=".LoginActivity"
            android:theme="@style/AuthTheme" />
        <activity
            android:name=".SplashActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:label="@string/app_name"
            android:theme="@style/SplashScreenTheme">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>
1
It is not working. giving another error Android Material and appcompat Manifest merger failed I found the reason is the ButterKnife library. Any idea on it? - Code Lover
Migrate to Android X and add compile option for Java 8 in gradle file. - Mehta

1 Answers

0
votes

i am facing same issue for fix that you have to check all third party lib version one on them is using android x lib. find that lib and reduce the lib version

one other way is you have to update you appcompat lib and other lib to android x lib