Gradle android studio 3.2 中的项目同步失败
Gradle project Sync failed in android studio 3.2
由于这个错误,我无法构建我的项目
错误:库 com.google.android.gms:play-services-basement 正在被位于 [[15.0.1,15.0.1]] 的各种其他库请求,但解析为 16.0.1。禁用插件并使用 ./gradlew :app:dependencies.
检查你的依赖关系树
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.3'
implementation 'com.google.firebase:firebase-storage:16.0.2'
implementation 'com.google.firebase:firebase-messaging:17.5.0'
implementation 'com.firebaseui:firebase-ui-database:4.3.1'
implementation 'com.github.jgabrielfreitas:BlurImageView:1.0.1'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:animated-vector-drawable:28.0.0-alpha1'
implementation 'com.android.support:support-media-compat:28.0.0-alpha1'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.rengwuxian.materialedittext:library:2.1.4'
implementation 'com.google.android.gms:play-services-analytics:16.0.0'
}
apply plugin: 'com.google.gms.google-services'
您需要将所有 Play 服务和 Firebase 库更新到最新版本。
您可以在此处找到每个库的最新版本https://mvnrepository.com/
尝试从
更改播放服务
implementation 'com.google.android.gms:play-services-analytics:16.0.0' to
implementation 'com.google.android.gms:play-services-analytics:15.0.1'
并尝试在项目 build.gradle
中添加以下 repos
allprojects {
repositories {
google()
jcenter()
}
}
由于这个错误,我无法构建我的项目
错误:库 com.google.android.gms:play-services-basement 正在被位于 [[15.0.1,15.0.1]] 的各种其他库请求,但解析为 16.0.1。禁用插件并使用 ./gradlew :app:dependencies.
检查你的依赖关系树dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.3'
implementation 'com.google.firebase:firebase-storage:16.0.2'
implementation 'com.google.firebase:firebase-messaging:17.5.0'
implementation 'com.firebaseui:firebase-ui-database:4.3.1'
implementation 'com.github.jgabrielfreitas:BlurImageView:1.0.1'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:animated-vector-drawable:28.0.0-alpha1'
implementation 'com.android.support:support-media-compat:28.0.0-alpha1'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.rengwuxian.materialedittext:library:2.1.4'
implementation 'com.google.android.gms:play-services-analytics:16.0.0'
}
apply plugin: 'com.google.gms.google-services'
您需要将所有 Play 服务和 Firebase 库更新到最新版本。
您可以在此处找到每个库的最新版本https://mvnrepository.com/
尝试从
更改播放服务implementation 'com.google.android.gms:play-services-analytics:16.0.0' to
implementation 'com.google.android.gms:play-services-analytics:15.0.1'
并尝试在项目 build.gradle
中添加以下 reposallprojects {
repositories {
google()
jcenter()
}
}