我需要向我的android应用程序添加推送通知,但是当我添加
apply plugin: 'com.google.gms.google-services'我犯了这个错误
Error:(75, 0) Version: 8.1.0 is lower than the minimum version (9.0.0) required for google-services plugin.这是我的bulld.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.0"
defaultConfig {
minSdkVersion 16
targetSdkVersion 19
versionCode 25
versionName "2.4"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
allprojects {
repositories {
jcenter()
}
}
repositories {
maven { url "https://jitpack.io" }
}
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.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:multidex:1.0.1'
compile 'com.github.PhilJay:MPAndroidChart:v2.1.3'
compile 'com.github.lzyzsd:circleprogress:1.1.0@aar'
compile 'com.commit451:PhotoView:1.2.4'
compile 'com.google.android.gms:play-services:8.1.0'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.slider:library:1.1.5@aar'
compile 'com.twotoasters.jazzylistview:library:1.2.1'
compile 'com.twotoasters.jazzylistview:library-recyclerview:1.2.1'
compile 'se.emilsjolander:stickylistheaders:2.7.0'
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.0'
compile 'me.nlmartian.silkcal:library:0.1.1'
compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0'
compile 'com.android.support:recyclerview-v7:21.1.0'
compile 'com.pushbots:pushbots-lib:2.0.13@aar'
compile 'com.android.support:support-v4:21.1.0'
compile 'com.makeramen:roundedimageview:2.3.0'
compile 'jp.wasabeef:blurry:2.1.1'
compile 'com.google.firebase:firebase-messaging:10.0.1'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'-
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:3.0.0'
}
}我试图用许多解决方案来解决这个问题,但我做不到,所以如果有人能帮我,请回答!
发布于 2017-06-01 14:12:15
您需要按照firebase的要求更新播放服务,所以可以使用上面的任何版本或等于9.0.0。
所以把这个替换
compile 'com.google.android.gms:play-services:8.1.0'有了这个
compile 'com.google.android.gms:play-services:10.2.6'并同步您的项目
错误:任务执行失败“:app:processDebugGoogleServices”。>文件google-services.json不见了。
获取Android应用程序的配置文件以下载Android应用程序的配置文件:
按照以下步骤执行
并复制google-services.json文件并将其粘贴到项目的app文件夹中
发布于 2017-06-01 14:15:08
检查您的build.gradle并更改此
compile 'com.google.android.gms:play-services:8.1.0'到这个
compile 'com.google.android.gms:play-services:10.2.6'或者更好的是--如果您只需要Firebase消息传递,就会删除这个导入。
https://stackoverflow.com/questions/44309840
复制相似问题