我還是 android 應(yīng)用程序的初學(xué)者,所以當(dāng)我嘗試構(gòu)建這個(gè)應(yīng)用程序時(shí),我在日志中收到以下錯(cuò)誤: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:5:5-31:19 to override.并且 build.grade 文件具有此依賴項(xiàng)dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 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.google.firebase:firebase-auth:16.1.0' implementation 'com.google.firebase:firebase-core:16.0.1' implementation 'com.google.firebase:firebase-storage:16.0.5' implementation 'com.google.firebase:firebase-database:16.0.5' implementation 'de.hdodenhof:circleimageview:3.0.0' implementation 'com.android.support:recyclerview-v7:28.0.0' implementation 'com.xwray:groupie:2.3.0' implementation 'com.xwray:groupie-kotlin-android-extensions:2.3.0' implementation 'com.squareup.picasso:picasso:2.71828'}我嘗試用谷歌搜索解決方案,但一無(wú)所獲。
2 回答

狐的傳說(shuō)
TA貢獻(xiàn)1804條經(jīng)驗(yàn) 獲得超3個(gè)贊
將這些行添加到gradle.properties
文件中:
android.useAndroidX=true android.enableJetifier=true
說(shuō)明:某些依賴項(xiàng),例如 com.xwray:groupie:2.3.0,使用 Android X。Jetifier需要使用 Android X 中的 android.support.* 類,如建議here。

HUWWW
TA貢獻(xiàn)1874條經(jīng)驗(yàn) 獲得超12個(gè)贊
我也記錄了一下再的個(gè)人上,是由于和android支持不接android設(shè)備上的。
查看當(dāng)前項(xiàng)目是否引用了androidx相關(guān)的庫(kù),請(qǐng)?jiān)俳K端里面執(zhí)行g(shù)radlew :app:dependencies >1.txt 然后查看是否有androidx的關(guān)鍵字,然后把相應(yīng)的導(dǎo)入庫(kù)也成為支持的能力。
添加回答
舉報(bào)
0/150
提交
取消