我收到以下错误:
Cannot change dependencies of configuration ':app:api' after it has been included in dependency resolution.
更新:当数据绑定被禁用时,我可以使用com.google.gms:google-services:3.3.0
构建,但对于需要启用数据绑定的人来说,这不是一个解决方案。
在谷歌宣布新的软件开发工具包版本控制系统(link)后,我执行了以下步骤:
build.gradle (main):
buildscript {
repositories {
google()
jcenter()
maven { url 'https://dl.bintray.com/rvalerio/maven' }
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:3.3.0'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'io.realm:realm-gradle-plugin:4.3.3'
classpath 'io.fabric.tools:gradle:1.25.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
maven { url 'https://maven.google.com' }
}
}
build.gradle (模块:app)
apply plugin: 'com.google.gms.google-services'
Firebase依赖关系:
//Firebase Dependencies
implementation "com.google.firebase:firebase-messaging:15.0.2"
implementation "com.google.firebase:firebase-core:15.0.2"
implementation "com.google.firebase:firebase-config:15.0.2"
implementation('com.crashlytics.sdk.android:crashlytics:2.9.1@aar') {
transitive = true
}
GMS和其他依赖项
implementation "com.android.support:recyclerview-v7:27.1.1"
implementation "com.android.support:support-v4:27.1.1"
implementation "com.android.support:cardview-v7:27.1.1"
implementation "com.android.support:design:27.1.1"
implementation "com.android.support:support-v13:27.1.1"
implementation "com.android.support.constraint:constraint-layout:1.1.0"
implementation "com.google.android.gms:play-services-location:15.0.1"
implementation "com.google.android.gms:play-services-vision:15.0.1"
implementation "com.google.android.gms:play-services-auth:15.0.1"
implementation "com.google.android.gms:play-services-maps:15.0.1"
我已经将错误日志从android studio 3.1.2 here.粘贴到了
如有任何帮助,我们不胜感激!
https://stackoverflow.com/questions/50166102
复制相似问题