(У него нет rc01) сбой манифеста: Атрибут application @ appComponentFactory value = (android.support.v4.app.CoreComponentFactory) - PullRequest
2 голосов
/ 06 июля 2019

он говорит об ошибке слияния манифеста, хотя мой манифест на самом деле прав

Это файл зависимости моего модуля приложения

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    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'
    implementation 'com.android.support:cardview-v7:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.google.firebase:firebase-core:17.0.0'
    implementation 'com.google.firebase:firebase-database:18.0.0'
    implementation 'com.firebaseui:firebase-ui-database:0.4.1'
    implementation 'com.android.support:recyclerview-v7:28.0.0'
}
apply plugin: 'com.google.gms.google-services'

Это ошибка

ошибка слияния манифеста: Атрибут application @ appComponentFactory value = (android.support.v4.app.CoreComponentFactory) из [com.android.support:support-compat:28.0.0-alpha3] AndroidManifest.xml: 22: 18-91 такжеприсутствует в [androidx.core: core: 1.0.0-alpha3] AndroidManifest.xml: 22: 18-86 value = (androidx.core.app.CoreComponentFactory).Предложение: добавьте 'tools: replace = "android: appComponentFactory"'

1 Ответ

0 голосов
/ 06 июля 2019

Проблема связана с библиотеками AndroidX.Перенесите ваши библиотеки поддержки на AndroidX.В AndroidStudio вы можете использовать меню Refactor> Migrate to AndroidX , чтобы сделать это вручную.Следите за изменениями с помощью VCS (например, git), чтобы увидеть, что происходит.

Также вы можете сделать это вручную, изменив зависимости gradle на:

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    //noinspection GradleCompatible
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'com.google.android.material:material:1.0.0'
    implementation 'com.google.firebase:firebase-core:17.0.0'
    implementation 'com.google.firebase:firebase-database:18.0.0'
    implementation 'com.firebaseui:firebase-ui-database:0.4.1'
    implementation 'androidx.recyclerview:recyclerview:1.0.0'
}
apply plugin: 'com.google.gms.google-services'

Затем найдите все старые зависимостиимпорт с новыми.Размещение этих флагов в вашем gradle.properties может исправить некоторые относительные проблемы:

android.enableJetifier=true
android.useAndroidX=true
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...