我是 android 的新手,有一個應用程序在構建我的項目時有這個錯誤 ::錯誤:清單合并失?。簛碜?[androidx.core:core:1.0.0] 的屬性 application@appComponentFactory 值 =(androidx.core.app.CoreComponentFactory) AndroidManifest.xml:22:18-86 也出現在 [com.android .support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 值=(android.support.v4.app.CoreComponentFactory)。建議:在 AndroidManifest.xml:9:5-44:19 處的元素中添加 'tools:replace="android:appComponentFactory"' 以覆蓋。我的 Gradle 構建是 ::apply plugin: 'com.android.application'apply plugin: 'com.google.gms.google-services'android { compileSdkVersion 28 buildToolsVersion "28.0.3" defaultConfig { applicationId "maa.tic_tac_to" minSdkVersion 19 targetSdkVersion 28 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } }}dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.google.firebase:firebase-messaging:19.0.1' androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) // implementation 'com.android.support:appcompat-v7:24.2.1' implementation 'com.android.support:appcompat-v7:28.0.0' // implementation 'com.android.support:support-v4:28.+' // implementation ('com.theartofdev.edmodo:android-image-cropper:2.4.+'){ // exclude group: 'com.android.support' //} // implementation 'com.google.android.material:material:1.0.0-alpha08' implementation 'com.android.support.constraint:constraint-layout:2.0.0-beta2' // implementation 'com.androidx.constraintlayout.widget:ConstraintLayout:2.0.0-beta2' testImplementation 'junit:junit:4.12'}我在 stackoverflow 和谷歌搜索中測試了每個解決方案,但任何人都可以幫助我。誰能幫忙解決這個錯誤????!????
1 回答

一只斗牛犬
TA貢獻1784條經驗 獲得超2個贊
您正在使用
implementation 'com.google.firebase:firebase-messaging:19.0.1'
Firebase 在最新版本中遷移到了 AndroidX。這意味著您同時使用支持庫和 androidx 庫。
你可以:
如下所述遷移到 androidx
降級你的 firebase 依賴項(但這不是一個真正的解決方案,因為你遲早要遷移)
您可以查看官方發行說明:
警告:此版本是主要版本更新和重大更改。Google Play 服務和 Firebase 的最新更新包括以下更改:
從 Android 支持庫遷移到 Jetpack (AndroidX) 庫。除非您在應用程序中進行以下更改,否則庫將無法工作:
升級
com.android.tools.build:gradle
到 v3.2.1 或更高版本。升級
compileSdkVersion
到 28 或更高版本。更新您的應用以使用 Jetpack (AndroidX);按照遷移到 AndroidX中的說明進行操作。
添加回答
舉報
0/150
提交
取消