从昨天开始(2018/08/14),我不能在不做任何更改的情况下构建我们的项目(两天前它还可以正常工作),因为出现了以下错误:
Failed to resolve: play-services-auth-base
我搜索了一下,发现有些解决方案说需要更新Firebase依赖项之类的。我们已经更新了所有Google的依赖项,但仍然出现错误。 这是我的Gradle Google依赖项:
//moudule level gradle
implementation 'com.google.firebase:firebase-auth:15.0.0'
implementation 'com.google.firebase:firebase-config:15.0.2'
implementation 'com.google.firebase:firebase-core:15.0.2'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
//project level build.gradle
classpath 'com.android.tools.build:gradle:3.2.0-alpha18'
classpath 'com.google.gms:google-services:4.0.1'
更新到这个版本后:
implementation 'com.google.firebase:firebase-auth:16.0.3'
implementation 'com.google.firebase:firebase-config:16.0.0'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.android.gms:play-services-auth:16.0.0'
我收到了这个错误信息:
The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[15.0.4,15.0.4], [16.0.0,16.0.0]], but resolves to 16.0.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
谷歌更新了Firebase: Firebase Android 更新说明
问题是什么?
classpath 'com.google.gms:google-services:4.0.1'
更改为classpath 'com.google.gms:google-services:4.0.2'
,并将classpath 'com.android.tools.build:gradle:3.2.0-alpha18'
更改为classpath 'com.android.tools.build:gradle:3.1.4'
吗?这会有任何区别吗? - Alex Mamofirebase-core
移动到依赖列表中其他 firebase 库的上方。请参考此相关问题:https://stackoverflow.com/q/51025793/4815718 - Bob Snyder