Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/182.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android Google Play服务与Firebase冲突_Android_Firebase_Google Play Services - Fatal编程技术网

Android Google Play服务与Firebase冲突

Android Google Play服务与Firebase冲突,android,firebase,google-play-services,Android,Firebase,Google Play Services,我想同时使用firebase和google play服务依赖项。但它也引起了一些冲突。当我添加play services依赖项时,firebase依赖项不起作用。您知道如何同时使用这两个依赖项吗?多谢各位 implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat-v7:26.1.0' implementation 'com.android.suppo

我想同时使用firebase和google play服务依赖项。但它也引起了一些冲突。当我添加play services依赖项时,firebase依赖项不起作用。您知道如何同时使用这两个依赖项吗?多谢各位

implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:26.1.0'
implementation 'com.google.firebase:firebase-core:12.0.1'
implementation 'com.google.firebase:firebase-messaging:12.0.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.google.android.gms:play-services:11.8.0'
更改此项:

implementation 'com.google.android.gms:play-services:11.8.0'
为此:

implementation 'com.google.android.gms:play-services:12.0.1'

com.google.android.gms:*和com.google.firebase:*15.0.0之前的依赖项版本必须相同。15.0.0之后,情况不再如此。有关更多详细信息,请参阅

需要注意的是,您也不应该再使用com.google.android.gms:play服务捕获所有单一目标,因为这包括allgoogle play服务和Firebase库到您的项目中,不必要地膨胀您的应用程序,因为您不太可能需要使用所有目标。有一段时间不鼓励这种用法,实际上在v15.0.0()中已删除