更改com.google.android.gms的版本:play-services
问题描述:
我有一个完美运行的旧应用程序 现在我想添加FCM通知。更改com.google.android.gms的版本:play-services
这是的build.gradle(模块:APP)
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.google.android.gms:play-services:7.0.0'
//compile 'com.google.firebase:firebase-messaging:10.0.1'
}
apply plugin: 'com.google.gms.google-services'
我得到第一误差是
错误:(37,0)版本:7.0.0小于最小低谷歌服务插件需要版本(9.0.0)。
我改变了版本为9.0.0
代码已经变成了这个样子
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.google.android.gms:play-services:9.0.0'
compile 'com.google.firebase:firebase-messaging:10.0.1'
}
apply plugin: 'com.google.gms.google-services'
,但我得到这个错误
所有com.google.android.gms库必须使用完全相同的版本规范(混合版本可能会导致运行时崩溃)。发现版本9.0.0,10.0.1。示例包括com.google.android.gms:play-services:9.0.0和com.google.android.gms:play-services-basement:10.0.1更多...(Ctrl + F1)
对于我改变了对10.0.1版本中提到
代码已经变成了这个样子
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.google.android.gms:play-services:10.0.1'
compile 'com.google.firebase:firebase-messaging:10.0.1'
}
应用插件:“com.google.gms.google服务”
现在,我得到此错误
错误:(802,97)错误:找不到符号法的GetMap()
使用前精细上班的GetMap功能,
我不知道com.google的版本。 android.gms:我必须使用play-services。
感谢
答
试试这个
compile 'com.google.android.gms:play-services:9.0.2'
使用的是在文档中提到的库。 – Noorul
我使用com.google.firebase:firebase-messaging:10.0.1 \t,如文档中所述,但错误与com.google.android.gms相关:play-services – asmgx