2017-08-25 116 views
0

我已經使用了類似下面的代碼的代碼。我得到這個例外。我根據我已經完成我的代碼的鏈接檢查了幾個鏈接。但仍然得到問題 請指教我解決這個問題請通過更新google-services插件的版本來修復版本衝突

錯誤:執行失敗的任務':app:processDebugGoogleServices'。

Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 10.2.6.

我喜歡這個

dependencies { 
compile fileTree(include: ['*.jar'], dir: 'libs') 
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
    exclude group: 'com.android.support', module: 'support-annotations' 
}) 
final RETROFIT = '2.3.0' 
final SUPPORT_LIBRARY_VERSION = '25.3.1' 
final FIREBASE_VERSION = '10.0.1' 
final PLAY_SERVICE = '10.2.6' 

//support 
compile "com.android.support:appcompat-v7:$SUPPORT_LIBRARY_VERSION" 
compile "com.android.support:design:$SUPPORT_LIBRARY_VERSION" 
compile "com.android.support:support-v4:$SUPPORT_LIBRARY_VERSION" 
compile "com.android.support:cardview-v7:$SUPPORT_LIBRARY_VERSION" 


compile 'com.android.support.constraint:constraint-layout:1.0.2' 
testCompile 'junit:junit:4.12' 

//api inspection 
compile 'com.facebook.stetho:stetho:1.4.2' 
compile 'com.facebook.stetho:stetho-okhttp3:1.4.2' 

//api 
compile "com.squareup.retrofit2:retrofit:$RETROFIT" 
compile "com.squareup.retrofit2:converter-gson:$RETROFIT" 
compile 'com.google.code.gson:gson:2.7' 

//play 
compile "com.google.android.gms:play-services-location:$PLAY_SERVICE" 
compile "com.google.android.gms:play-services-analytics:$PLAY_SERVICE" 

//push 
compile "com.google.firebase:firebase-core:$FIREBASE_VERSION" 

//mutlidex 
compile 'com.android.support:multidex:1.0.0' 
//image 
compile 'com.github.bumptech.glide:glide:3.7.0' 
//log 
compile 'com.jakewharton.timber:timber:4.5.1' 
//scan 
compile 'com.google.zxing:core:3.0.1' 
//others 
compile 'me.relex:circleindicator:1.2.2' 
} 

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

您發佈的錯誤消息似乎並不完整。消息之前的輸出是什麼? – Haem

回答

4

gradle這個您正在使用不同版本的同一個庫中。

final FIREBASE_VERSION = '10.0.1' 
final PLAY_SERVICE = '10.2.6 

請記住,Firebase與Google Play服務庫存在相關性。