android – 无法解决:com.google.firebase:firebase-core:9.6.0

前端之家收集整理的这篇文章主要介绍了android – 无法解决:com.google.firebase:firebase-core:9.6.0前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
根据FB文档 here做了一切但是
编译时我仍然会收到以下错误
Error:(44,13) Failed to resolve: com.google.firebase:firebase-core:9.6.0

我的SDK管理员说一切都是最新的:

Google Play services Rev. 33 installed
Google Repository Rev. 35 installed

这是我的build.gradle内容

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion '23.0.3'

    defaultConfig {
        applicationId "xxxx.xxxx"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 14
        versionName "1.0"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
        }
    }
}

dependencies {
    // Support libraries
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
    // Google APIs
    // Note: Avoid compiling the entire play-services package.
    compile 'com.google.android.gms:play-services-gcm:9.4.0'
    compile 'com.google.android.gms:play-services-location:9.4.0'
    compile 'com.google.android.gms:play-services-maps:9.4.0'
    compile 'com.google.android.gms:play-services-places:9.4.0'
    compile 'com.google.maps.android:android-maps-utils:0.4.4'

    compile 'org.jsoup:jsoup:1.9.2'
    compile 'com.google.code.gson:gson:2.7'
    compile 'io.branch.sdk.android:library:2.+'
    compile 'com.google.firebase:firebase-core:9.6.0' //<-- CAUSING TROUBLE
}

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

这是我的root级build.gradle内容

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.3'
        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()
    }
}

为什么不编译?

解决方法

尝试编译’com.google.firebase:firebase-messaging:9.4.0’而不是编译’com.google.firebase:firebase-core:9.6.0′
原文链接:https://www.f2er.com/android/313953.html

猜你在找的Android相关文章