1 回答

TA贡献1850条经验 获得超11个赞
更新以下内容:
classpath 'com.google.gms:google-services:4.0.1'
对此:
classpath 'com.google.gms:google-services:4.1.0'
也如文档中所述:
注意:不要使用组合
play-services
目标。它引入了数十个库,使您的应用程序膨胀。相反,只指定您的应用使用的特定 Google Play 服务 API。
因此,删除此:
implementation 'com.google.android.gms:play-services:11.0.4'
并添加具有更新版本的特定 google play 服务 api,例如 implementation 'com.google.android.gms:play-services-auth:16.0.1'
还将 firebase-core 更新为版本 16.0.4
在这里查看更多信息:
https://developers.google.com/android/guides/setup
当您收到此错误时:
[[15.0.1,15.0.1]] 的各种其他库正在请求库 com.google.android.gms:play-services-basement,但解析为 16.0.1。
这意味着您在 gradle 中使用的直接依赖项(在 google maven 存储库中)正在使用传递依赖项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
,因此您会收到此错误。
您还可以在 2018 年 10 月 2 日检查这一点,他们执行了以下操作:
对其他使用的一些核心库(play-services-auth、play-services-base、play-services-basement、play-services-flags、play-services-stats、play-services-tasks)进行了较小的内部功能更新Google Play 服务库。
他们还发布了com.google.android.gms:play-services-basement:16.0.1
和com.google.firebase:firebase-core:16.0.4
添加回答
举报