Google Play服务-找不到依赖项

时间:2018-07-16 07:21:54

标签: android google-maps android-studio android-gradle google-play-services

我第一次构建应用程序,它在Google Map上运行良好,但是当我将Firebase添加到应用程序时出现了问题。 我更改了一些依赖关系,并且在与Gradle文件同步后发生了此错误:

  

无法解决:com.google.android.gms:play-services:15.0.1

     

安装存储库并同步项目

     

显示在文件中

     

在“项目结构”对话框中显示

很显然,我尝试单击安装存储库并同步项目。在安装过程中,发生了另一个错误:

  

找不到依赖项“ com.google.android.gms:play-services:15.0.1”

这是我在build.gradle文件中的依赖项。如您所见,我没有忘记使用实现'com.google.android.gms:play-services:15.0.1'

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    implementation 'com.android.support:support-annotations:28.0.0-alpha3'
    implementation 'com.google.firebase:firebase-auth:16.0.2'
    implementation 'com.google.firebase:firebase-core:16.0.1'
    implementation 'com.google.firebase:firebase-database:16.0.1'
    implementation 'com.google.android.gms:play-services:15.0.1'
    implementation 'com.google.android.gms:play-services-maps:15.0.1'
    implementation 'com.google.android.gms:play-services-auth:15.0.1'
    implementation 'com.google.android.gms:play-services-identity:15.0.1'
    implementation 'com.google.android.gms:play-services-location:15.0.1'

    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'
}

我发现有同样问题的人,并尝试了许多建议的解决方案,但问题仍未解决。

1 个答案:

答案 0 :(得分:-1)

您可以在我的build.gradle项目文件下面看到。

buildscript {
    repositories {
        google()
        jcenter()
    }
dependencies {
        classpath 'com.google.gms:google-services:4.0.1'
        classpath 'com.android.tools.build:gradle:3.3.0-alpha03'
    }
}
allprojects {
    repositories {
        google()
        jcenter()
    }
}
task clean(type: Delete) {
    delete rootProject.buildDir
}