Incompatible libraries in gradle

社会主义新天地 提交于 2020-01-06 03:10:05

问题


i want to use gcm in my app, but while adding dependancies in gradle file i got error of incompatible libraries. my app level gradle file have dependancies as follows ..

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'
}

and i have added classpath 'com.google.gms:google-services:1.5.0-beta2' in my project level gradle.

my google play services is updated to latest version but still it shows error like.. All libraries must use the exact same version specifications. After checking i got know that it conflicts compile 'com.appvirality:AppviralityUI:1.1.18+' library.

Thanks


回答1:


At first you need to change this

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

Use

apply plugin: 'com.android.application'

You can set your classpath as classpath 'com.android.tools.build:gradle:1.5.0'




回答2:


Dont know how.. but, Got it wroking just by changing compile 'com.google.android.gms:play-services-gcm:8.3.0' to compile 'com.google.android.gms:play-services:8.3.0'



来源:https://stackoverflow.com/questions/34506648/incompatible-libraries-in-gradle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!