android - Android同步失败-找不到com.google.android.gms:play-services-auth:15.1.0

标签 android gradle

完整错误是:

Could not find com.google.android.gms:play-services-auth:15.1.0. Searched in the following locations: file:/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.pom file:/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.jar file:/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 file:/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 file:/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 file:/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 Required by: project :app



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
}

最佳答案

我认为没有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
基本上,您不能为不同的服务使用相同的版本号。

关于android - Android同步失败-找不到com.google.android.gms:play-services-auth:15.1.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50439504/

相关文章:

android - 中断构建流程,并在Gradle Android Studio中包含任务

android - 您如何在 firestore android 的事务中遍历子集合中的文档?

java - Gradle 构建因从服务器 : Proxy Authentication Required, 接收到状态代码 407 而失败,但具有类似 deps 的另一个项目成功

带有平台签名的 Android Gradle 构建

java - 错误 : Could not find com. android.tools.build :gradle:3. 5.2

android - Android无法从AndroidManifest.xml读取packageName

Android - Tomcat - MySQL 困惑,这样的应用设计是否可行?

android - 我什么时候应该断开 GoogleApiClient (Android)

Android : Extract article main content. 如何仅提取内容img并删除图标img

android - 如何将Visual Studio宏传递到android gradle构建脚本中?