我有一个主应用程序和一个包装所有firebase相关代码的模块。
我遇到的问题是,只要我将firebase依赖项从api
更改为implementation
,我就无法再编译项目了。我的主项目构建失败,出现以下错误:
错误
Error:FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:preDevDeDebugBuild'.
> Android dependency 'com.google.firebase:firebase-core' has different version for the compile (9.0.0) and runtime (11.8.0) classpath. You should manually set the same version via DependencyResolution
我的主应用程序如下所示:
dependencies {
implementation project(':module-firestore')
// NO OTHER FIRESTORE IMPORTS; NOT HERE NOT IN ANY OTHER MODULE!
}
apply plugin: 'com.google.gms.google-services'
我的firebase模块如下所示:
dependencies {
// ----------------------
// Firebase
// ----------------------
api "com.google.firebase:firebase-core:${versions.playServices}"
api "com.google.firebase:firebase-auth:${versions.playServices}"
api "com.google.firebase:firebase-ads:${versions.playServices}"
api "com.google.firebase:firebase-firestore:${versions.playServices}"
// ----------------------
// Firebase UI
// ----------------------
implementation ('com.firebaseui:firebase-ui-auth:3.2.2') {
exclude group: 'com.android.support'
}
}
全球财产
ext {
versions = [supportLib: "27.1.0",
playServices: "11.8.0"]
}