我想在Android Studio上設置Firebase雲消息傳遞客戶端應用程序 我正在使用Android的最新版本工作室(2.3.3)和我的android SDK完全更新。無法解析Android Studio 2.3.3中的'com.google.firebase:firebase-messaging:11.0.4'
這裏是我的項目gradle這個文件:
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這個文件:
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'
,我總是給這個錯誤:
Error:(30, 13) Failed to resolve: compile 'com.google.firebase:firebase-messaging:11.0.4'
的intresting這裏指的是,當我將版本從11.0.4更改爲10.0.1時,沒有發生錯誤,並且gradle build成功! 我閱讀了所有在stackoverflow和谷歌開發人員網站上的帖子,但是這個錯誤依然存在! 任何想法歡迎...
編輯1: 當我去查找更新我沒有看到有關圖像在這裏更新谷歌播放服務的任何選項: enter image description here
請確保您有最新的谷歌存儲庫在Android SDK管理器 – Bob
在Android SDK管理器,谷歌存儲庫版本爲51 –