android - 找不到 com.google.firebase :firebase-core:9. 0.0

标签 android firebase

在遵循有些不一致的说明后herehere执行 gradle 同步时出现错误提示 could not find com.google.firebase:firebase-core:9.0.0

对为什么会发生这种情况有任何想法吗?

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

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

最佳答案

首先,您需要将Play Services Library更新为rev.30:

enter image description here

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

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

您可能需要将其更正为:

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

关于android - 找不到 com.google.firebase :firebase-core:9. 0.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37307859/

相关文章:

android - 加载页面时 xWalkWebView?

android - DownloadManager 双下载

java - Android创建特定布局(仅限XML)

Android 应用程序与华硕 NEXUS 7 不兼容

database - swift 。如何从 Firebase 数据库中选择一个随机用户?

java - Firebase 在应用启动时检索所有数据

android - 如何在Android中进行图像着色

firebase - 如何在 Firebase 中的用户之间共享数据?

android - 安装 FirebaseAuth.unitypackage 时出错,Gradle 无法获取依赖项

firebase - 如何在列表中添加新项目?