2017-10-04 16 views
1

错误当我同步我的项目,然后告诉我(执行失败的任务 ':应用程序:processDebugGoogleServices'),但我有谷歌,services.json添加

Execution failed for task ':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 11.4.2.

代码

dependencies { 
     implementation fileTree(include: ['*.jar'], dir: 'libs') 
     implementation 'com.android.support:appcompat-v7:26.0.1' 
     implementation 'com.android.support.constraint:constraint-layout:1.0.2' 
     implementation 'com.google.firebase:firebase-core:11.0.4' 
     testImplementation 'junit:junit:4.12' 
     androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', { 
      exclude group: 'com.android.support', module: 'support-annotations' 
     }) 
     compile 'com.android.support:cardview-v7:26.0.1' 
     compile 'com.android.support:recyclerview-v7:26.0.1' 
     compile 'com.android.support:design:26.0.1' 
     compile 'com.android.volley:volley:1.0.0' 
     compile 'com.squareup.picasso:picasso:2.4.0' 
     compile 'com.google.android.gms:play-services-ads:11.4.2' 
     compile 'com.google.firebase:firebase-messaging:11.4.2' 
     compile 'com.google.firebase:firebase-core:11.4.2' 

    } 


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

回答

2

问题是这样的:

implementation 'com.google.firebase:firebase-core:11.0.4' 

虽然其他图书馆是一个不同的版本:

compile 'com.google.android.gms:play-services-ads:11.4.2' 
compile 'com.google.firebase:firebase-messaging:11.4.2' 
compile 'com.google.firebase:firebase-core:11.4.2' 

的GSM的版本/火力库必须匹配,否则,你得到这个错误。

你改变的是由你决定的,但是所有的版本都必须匹配。如果你改变了火力核实现线:

implementation 'com.google.firebase:firebase-core:11.4.2' 

它将工作。请注意,这是一个普遍的答案;任何Firebase或GSM库都必须在版本中匹配。它与什么依赖关系无关,它适用于所有

+0

谢谢先生。为了解决我的问题。 –

+0

请记住接受答案,以便其他人知道问题已解决 – Zoe

+0

两者都需要? compile'c​​om.google.firebase:firebase-core:11.4.2' implementation'com.google.firebase:firebase-core:11.4.2' –

相关问题