无法在Android Studio 2.3.3中解析'com.google.firebase:firebase-messaging:11.0.4' [英] Failed to resolve 'com.google.firebase:firebase-messaging:11.0.4' in Android Studio 2.3.3

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

问题描述

我想在Android Studio上设置Firebase Cloud Messaging Client App, 我正在使用最新版本的Android Studio(2.3.3),并且我的android SDK已完全更新.

I want to Set up a firebase Cloud Messaging Client App on Android studio, I am using latest version of Android studio(2.3.3) and my android SDK is fully updated.

这是我的项目gradle文件:

Here is my project gradle file:

 buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.google.gms:google-services:3.1.0'
        classpath 'com.android.tools.build:gradle:2.3.3'
    }
}

allprojects {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }
}

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

这是我的应用程序构建gradle文件:

and this is my app build gradle file :

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.3"
    defaultConfig {
        applicationId "ir.digiwindow.driver.gps_status"
        minSdkVersion 14
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
    testCompile 'junit:junit:4.12'
    compile 'com.google.firebase:firebase-messaging:11.0.4'


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

并且我总是给出这个错误:

and I always give this error :

Error:(30, 13) Failed to resolve: compile 'com.google.firebase:firebase-messaging:11.0.4'

这里有趣的一点是,当我将版本从11.0.4更改为10.0.1时,没有错误发生,并且gradle构建成功! 我阅读了stackoverflow和Google Developer网站中的所有相关文章,但此错误仍然存​​在! 欢迎任何想法...

The interesting point here is that when I change version from 11.0.4 to 10.0.1 no error occurs and gradle build successfully! I read all related posts in stackoverflow and google developer site, but this error still exists! Any ideas welcome...

当我去查找更新时,图像中没有显示有关更新Google Play服务的任何选项:

Edit 1: when I go to look for updates I don't see any option about updating google play service here in the image:

推荐答案

我遇到了同样的问题,我通过更新两件事解决了该问题

I have faced the same problem, I have resolved it by updating two things

  1. Google Play服务
  2. Google存储库

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

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