当我有这些依赖项时,我所有的代码都可以正常工作
//noinspection GradleCompatible
implementation 'com.google.android.gms:play-services-places:11.0.4'
implementation 'com.google.android.gms:play-services-location:11.0.4'
implementation 'com.google.android.gms:play-services-maps:11.0.4'
implementation 'com.google.maps.android:android-maps-utils:0.5+'
implementation 'com.google.firebase:firebase-auth:11.0.4'
implementation 'com.google.firebase:firebase-core:11.0.4'
implementation 'com.google.firebase:firebase-messaging:11.0.4'
implementation 'com.google.firebase:firebase-storage:11.0.4'
implementation 'com.google.firebase:firebase-database:11.0.4' }
但是当我添加
implementation 'com.google.android.gms:play-services-ads-identifier:15.0.1'
它告诉我以下错误:-
错误:各种其他库正在[[11.0.4,11.0.4]]请求库com.google.android.gms:play-services-basement,但解析为15.0.1。禁用插件,并使用./gradlew:app:dependencies检查您的依赖关系树。
我已经尝试更新我的gms库,但是当我这样做时,我将需要对代码进行几处更改以满足新的发行要求。我正在寻找解决它的快速解决方案。
我正在使用的当前版本如下:-
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:4.0.2'
答案 0 :(得分:0)
使用以下内容
implementation 'com.google.android.gms:play-services-places:16.0.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'com.google.maps.android:android-maps-utils:0.5+'
implementation 'com.google.firebase:firebase-auth:16.2.0'
implementation 'com.google.firebase:firebase-core:16.0.8'
implementation 'com.google.firebase:firebase-messaging:17.5.0'
implementation 'com.google.firebase:firebase-storage:16.1.0'
implementation 'com.google.firebase:firebase-database:16.1.0'
代替此
implementation 'com.google.android.gms:play-services-places:11.0.4'
implementation 'com.google.android.gms:play-services-location:11.0.4'
implementation 'com.google.android.gms:play-services-maps:11.0.4'
implementation 'com.google.maps.android:android-maps-utils:0.5+'
implementation 'com.google.firebase:firebase-auth:11.0.4'
implementation 'com.google.firebase:firebase-core:11.0.4'
implementation 'com.google.firebase:firebase-messaging:11.0.4'
implementation 'com.google.firebase:firebase-storage:11.0.4'
implementation 'com.google.firebase:firebase-database:11.0.4'