首页 > 解决方案 > 无法解决:Android Studio 3.1.3 中的 com.google

问题描述

添加 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'

`

我提到了“无法解决:com.google.firebase:firebase-core:9.0.0 ”,但是没有用。先感谢您。

标签: androidandroid-studio

解决方案


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


推荐阅读