Android 同步失败 - 找不到 com.google.android.gms:play-services-auth:15.1.0
Posted
技术标签:
【中文标题】Android 同步失败 - 找不到 com.google.android.gms:play-services-auth:15.1.0【英文标题】:Android sync fails - Could not find com.google.android.gms:play-services-auth:15.1.0 【发布时间】:2018-10-30 13:24:38 【问题描述】:完整的错误是:
找不到 com.google.android.gms:play-services-auth:15.1.0。 在以下位置搜索: 文件:/C:/Users/Alex/AppData/Local/Android/sdk/extras/m2repository/com/google/android/gms/play-services-auth/15.1.0/play-services-auth-15.1.0。绒球 文件:/C:/Users/Alex/AppData/Local/Android/sdk/extras/m2repository/com/google/android/gms/play-services-auth/15.1.0/play-services-auth-15.1.0。罐 文件:/C:/Users/Alex/AppData/Local/Android/sdk/extras/google/m2repository/com/google/android/gms/play-services-auth/15.1.0/play-services-auth-15.1。 0.pom 文件:/C:/Users/Alex/AppData/Local/Android/sdk/extras/google/m2repository/com/google/android/gms/play-services-auth/15.1.0/play-services-auth-15.1。 0.jar 文件:/C:/Users/Alex/AppData/Local/Android/sdk/extras/android/m2repository/com/google/android/gms/play-services-auth/15.1.0/play-services-auth-15.1。 0.pom 文件:/C:/Users/Alex/AppData/Local/Android/sdk/extras/android/m2repository/com/google/android/gms/play-services-auth/15.1.0/play-services-auth-15.1。 0.jar https://jcenter.bintray.com/com/google/android/gms/play-services-auth/15.1.0/play-services-auth-15.1.0.pom https://jcenter.bintray.com/com/google/android/gms/play-services-auth/15.1.0/play-services-auth-15.1.0.jar https://dl.google.com/dl/android/maven2/com/google/android/gms/play-services-auth/15.1.0/play-services-auth-15.1.0.pom https://dl.google.com/dl/android/maven2/com/google/android/gms/play-services-auth/15.1.0/play-services-auth-15.1.0.jar https://maven.google.com/com/google/android/gms/play-services-auth/15.1.0/play-services-auth-15.1.0.pom https://maven.google.com/com/google/android/gms/play-services-auth/15.1.0/play-services-auth-15.1.0.jar 要求: 项目:应用程序
build.gradle(Module:app)
apply plugin: 'com.android.application'
android
compileSdkVersion 25
buildToolsVersion '27.0.3'
defaultConfig
applicationId "alex.ness.edu.xmlandfirebaseandloginto"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
buildTypes
release
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
dependencies
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2',
exclude group: 'com.android.support', module: 'support-annotations'
)
implementation 'com.android.support:appcompat-v7:25.4.0'
implementation 'com.android.support:design:25.4.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:support-v4:25.4.0'
implementation 'com.android.support:recyclerview-v7:25.4.0'
implementation 'org.jsoup:jsoup:1.10.3'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.android.support:cardview-v7:25.4.0'
implementation 'com.google.firebase:firebase-auth:15.1.0'
implementation 'com.google.android.gms:play-services-auth:15.1.0'
implementation 'com.google.firebase:firebase-messaging:15.1.0'
testCompile 'junit:junit:4.12'
implementation 'com.beardedhen:androidbootstrap:2.3.1'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'com.firebaseui:firebase-ui-auth:2.3.0'
apply plugin: 'com.google.gms.google-services'
build.gradle(项目)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript
repositories
jcenter()
maven url 'https://maven.fabric.io/public'
google()
dependencies
classpath 'com.android.tools.build:gradle:3.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.3.0'
allprojects
repositories
jcenter()
google()
maven url "https://maven.google.com"
task clean(type: Delete)
delete rootProject.buildDir
【问题讨论】:
【参考方案1】:我认为没有 15.1.0。你应该使用 15.0.1 com.google.android.gms:play-services-auth:15.0.1
有新的服务版本: https://android-developers.googleblog.com/2018/05/announcing-new-sdk-versioning.html 基本上你不能为不同的服务假设相同的版本号。
【讨论】:
我改变了: implementation 'com.google.android.gms:play-services-auth:15.0.1' implementation 'com.google.firebase:firebase-messaging:15.0.2' 并得到这个错误清单合并失败:来自 [com.android.support:design:26.0.1] AndroidManifest.xml:28:13-35 的属性 meta-data#android.support.VERSION@value value=(26.0.1) 也存在在 [com.android.support:support-v4:26.1.0] AndroidManifest.xml:28:13-35 值=(26.1.0)。建议:将 'tools:replace="android:value"' 添加到 AndroidManifest.xml:26:9-28:38 的您需要将后一个依赖项的版本更新为15.0.2
。这解决了 Google 服务 Gradle
插件的版本 3.3.0
报告的问题。
或切换到旧版本 -
在build.gradle
implementation 'com.google.firebase:firebase-auth:11.0.4'
在项目中 - build.gradle
classpath 'com.google.gms:google-services:3.2.1' // google-services plugin
【讨论】:
我改变了: implementation 'com.google.android.gms:play-services-auth:15.0.1' implementation 'com.google.firebase:firebase-messaging:15.0.2' 并得到这个错误清单合并失败:来自 [com.android.support:design:26.0.1] AndroidManifest.xml:28:13-35 的属性 meta-data#android.support.VERSION@value value=(26.0.1) 也存在在 [com.android.support:support-v4:26.1.0] AndroidManifest.xml:28:13-35 值=(26.1.0)。建议:将 'tools:replace="android:value"' 添加到 AndroidManifest.xml:26:9-28:38 中的以上是关于Android 同步失败 - 找不到 com.google.android.gms:play-services-auth:15.1.0的主要内容,如果未能解决你的问题,请参考以下文章
Gradle 同步失败:com.android.tools.idea.gradle.project.sync.idea.issues.SdkPlatformNotFoundException:模块:找