【问题标题】:Failed to resolve: com.google in Android Studio 3.1.3无法解决:Android Studio 3.1.3 中的 com.google
【发布时间】:2018-07-03 17:00:08
【问题描述】:

添加 Firebase 依赖项会出现以下错误:

Failed to resolve: com.google

这是我的 app/build.gradle

`

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.xxxxxxx.xxxxx"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'
    implementation 'com.google.firebase: firebase-core: 16.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    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'
}

apply plugin: 'com.google.gms.google-services'

`

我提到了“Failed to resolve: com.google.firebase:firebase-core:9.0.0”,但是没有用。 提前谢谢你。

【问题讨论】:

    标签: android android-studio


    【解决方案1】:

    检查此行implementation 'com.google.firebase: firebase-core: 16.0.0' com.google.firebase:firebase-core:16.0.0 之间有一个空格。删除那些空格

    【讨论】:

    • 谢谢以西结。有效。我从 firebase 站点获取了所有依赖项进行设置。
    猜你喜欢
    • 2013-06-14
    • 1970-01-01
    • 1970-01-01
    • 2018-11-27
    • 1970-01-01
    • 2019-01-08
    • 2019-01-07
    • 2018-11-20
    • 1970-01-01
    相关资源
    最近更新 更多