1 回答

TA貢獻(xiàn)1850條經(jīng)驗(yàn) 獲得超11個(gè)贊
更新以下內(nèi)容:
classpath 'com.google.gms:google-services:4.0.1'
對(duì)此:
classpath 'com.google.gms:google-services:4.1.0'
也如文檔中所述:
注意:不要使用組合
play-services
目標(biāo)。它引入了數(shù)十個(gè)庫(kù),使您的應(yīng)用程序膨脹。相反,只指定您的應(yīng)用使用的特定 Google Play 服務(wù) API。
因此,刪除此:
implementation 'com.google.android.gms:play-services:11.0.4'
并添加具有更新版本的特定 google play 服務(wù) api,例如 implementation 'com.google.android.gms:play-services-auth:16.0.1'
還將 firebase-core 更新為版本 16.0.4
在這里查看更多信息:
https://developers.google.com/android/guides/setup
當(dāng)您收到此錯(cuò)誤時(shí):
[[15.0.1,15.0.1]] 的各種其他庫(kù)正在請(qǐng)求庫(kù) com.google.android.gms:play-services-basement,但解析為 16.0.1。
這意味著您在 gradle 中使用的直接依賴項(xiàng)(在 google maven 存儲(chǔ)庫(kù)中)正在使用傳遞依賴項(xiàng)com.google.android.gms:play-services-basement
。
在這種情況下,firebase-core:16.0.1
使用play-services-basement:15.0.1
最新版本的play-services-basement
is 16.0.1
,因此您會(huì)收到此錯(cuò)誤。
您還可以在 2018 年 10 月 2 日檢查這一點(diǎn),他們執(zhí)行了以下操作:
對(duì)其他使用的一些核心庫(kù)(play-services-auth、play-services-base、play-services-basement、play-services-flags、play-services-stats、play-services-tasks)進(jìn)行了較小的內(nèi)部功能更新Google Play 服務(wù)庫(kù)。
他們還發(fā)布了com.google.android.gms:play-services-basement:16.0.1
和com.google.firebase:firebase-core:16.0.4
添加回答
舉報(bào)