无法解析com.google.firebase:firebase-core:10.0.1 [英] failed to resolve com.google.firebase:firebase-core:10.0.1

查看:143
本文介绍了无法解析com.google.firebase:firebase-core:10.0.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的Android应用中使用Firebase Cloud Messaging. 这是我的应用程序级别gradle文件

I want to use Firebase Cloud Messaging in my Android App. This is my app level gradle file

apply plugin: 'com.android.application'
android {
    signingConfigs {
        config {
            keyAlias 'androiddebugkey'
            keyPassword 'android'
        }
        config1 {
            keyPassword 'android'
        }
    }
    compileSdkVersion 23
    buildToolsVersion "23.0.3"
    packagingOptions {
        exclude 'main/AndroidManifest.xml'
    }
    defaultConfig {
        applicationId "com.shikhar.dexter.project"
        minSdkVersion 19
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')

    compile 'com.google.firebase:firebase-messaging:10.0.1'

    compile 'com.android.support:appcompat-v7:23.4.0'
    compile 'com.android.support:design:23.4.0'
    compile 'com.android.support:cardview-v7:23.4.0'
    compile 'com.android.support:recyclerview-v7:23.4.0'
    compile 'com.android.support:support-v4:23.4.0'

    compile 'com.google.android.gms:play-services:9.0.0'
    compile 'com.google.android.gms:play-services-auth:9.0.0'

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

这是我的根目录gradle文件

This is my root level gradle file

   // 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.2.3'
        classpath 'com.google.gms:google-services:3.0.0'
        classpath 'com.android.tools.build:gradle:2.1.0'

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

allprojects {
    repositories {
        jcenter()
        maven{
            url  "http://dl.bintray.com/dasar/maven"
        }
    }
}

在编译时显示以下错误:

While compiling it shows these Errors:

Failed to resolve: com.google.firebase:firebase-core:10.0.1

Error:(36, 13) Failed to resolve: com.google.firebase:firebase-messaging:10.0.1

我尝试使用9.4.0等各种Google Play服务版本,但仍然无法正常工作.

I tried with various Google Play Services Versions like 9.4.0 but still it doesn't work.

推荐答案

打开SDK Manager,并确保已下载最新的"Google Play服务"依赖项.

Open SDK Manager and make sure you have latest "Google Play Services" dependency downloaded.

这篇关于无法解析com.google.firebase:firebase-core:10.0.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆