После определения ButterKnife слияние манифеста завершилось неудачно: атрибут application @ appComponentFactory error - PullRequest
0 голосов
/ 02 июля 2019

У меня проблема с файлом манифеста Android в моем проекте Android после добавления зависимости ButterKnife в файл gradle.

Когда я запускаю программу, она выдает ошибку, показанную ниже.

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

Вот мой файл.

<application
        tools:replace="android:allowBackup,android:icon,android:label,android:roundIcon,android:supportsRtl,android:theme"
        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=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

Build.gradle file

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testİmplementation 'junit:junit:4.12'
    androidTestİmplementation 'com.android.support.test:runner:1.0.2'
    androidTestİmplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

    // TODO 1) ButterKnife Library Defined
    implementation 'com.jakewharton:butterknife:10.1.0'
    annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0'
}

1 Ответ

2 голосов
/ 02 июля 2019

Вы не можете использовать butterknife: 10.xx, если вы также не перешли на AndroidX.Если вы еще не мигрировали, вам нужно придерживаться версии 9.0.0.После миграции вы можете обновить до 10.1.0 (или более поздней версии).-

...