我想在我的应用程序中使用gcm,但在gradle文件中添加依赖项时,我收到了不兼容库的错误。 我的应用级gradle文件具有如下依赖..
apply plugin: 'com.google.gms.google-services'
.
.
.
.
.
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.squareup.retrofit:retrofit:2.0.0-beta2'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.squareup.okhttp:okhttp:2.6.0'
compile 'com.squareup.retrofit:converter-gson:2.0.0-beta2'
compile 'com.squareup.okhttp:logging-interceptor:2.6.0'
compile 'com.facebook.android:facebook-android-sdk:4.7.0'
compile 'com.appvirality:AppviralityUI:1.1.18+'
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.android.gms:play-services-gcm:8.3.0'
}
我添加了classpath 'com.google.gms:google-services:1.5.0-beta2'
在我的项目级别gradle。
我的Google Play服务已更新至最新版本,但仍显示错误,例如..
所有库必须使用完全相同的版本规范。
检查后我知道它与compile 'com.appvirality:AppviralityUI:1.1.18+'
库有冲突。
由于
答案 0 :(得分:1)
首先你需要改变这个
apply plugin: 'com.google.gms.google-services'
使用
apply plugin: 'com.android.application'
您可以将类路径设置为classpath 'com.android.tools.build:gradle:1.5.0'
答案 1 :(得分:0)
不知道如何...但是,只需将编译'com.google.android.gms:play-services-gcm:8.3.0'
更改为compile 'com.google.android.gms:play-services:8.3.0'