无法找到com.google.firebase:firebase-core:9.0.0 [duplicate]

时间:2023-02-09 15:18:57

This question already has an answer here:

这个问题已经有了答案:

After following the somewhat inconsistent instructions here and here I get an error when performing a gradle sync saying could not find com.google.firebase:firebase-core:9.0.0

在这里和这里执行了一些不一致的指令之后,当执行一个等级同步时,我得到一个错误,说找不到com.google.firebase:firebase-core:9.0.0

Any ideas to why this is happening?

你知道为什么会这样吗?

app/build.gradle

app / build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"
    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
        free {
            applicationId ... 
        }

        paid {
            applicationId ... 
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.3.0'
    compile 'com.android.support:support-v4:23.3.0'

    freeCompile 'com.google.firebase:firebase-core:9.0.0'
    freeCompile 'com.google.firebase:firebase-ads:9.0.0:9.0.0'
}

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

root/build.gradle

根/ build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.0'
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
        classpath 'com.google.gms:google-services:3.0.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

1 个解决方案

#1


51  

First, you need to update Play Services Library to rev.30:

首先,需要更新Play服务库rev.30:

无法找到com.google.firebase:firebase-core:9.0.0 [duplicate]

and then you have a little issue in this line:

然后在这一行有一个小问题

freeCompile 'com.google.firebase:firebase-ads:9.0.0:9.0.0'

you probably need to correct it to this:

你可能需要修正一下:

freeCompile 'com.google.firebase:firebase-ads:9.0.0'

#1


51  

First, you need to update Play Services Library to rev.30:

首先,需要更新Play服务库rev.30:

无法找到com.google.firebase:firebase-core:9.0.0 [duplicate]

and then you have a little issue in this line:

然后在这一行有一个小问题

freeCompile 'com.google.firebase:firebase-ads:9.0.0:9.0.0'

you probably need to correct it to this:

你可能需要修正一下:

freeCompile 'com.google.firebase:firebase-ads:9.0.0'