失败:构建因异常而失败。
请通过更新google-services插件的版本(https://bintray.com/android/android-tools/com.google.gms.google-services/提供有关最新版本的信息)或将com.google.android.gms的版本更新为9.0.0来修复版本冲突。
![]()
答案 0 :(得分:1)
简便解决方案是从我的github帐户安装此更新的插件: 删除fcm插件:
ionic cordova plugin remove cordova-plugin-fcm-with-dependecy-updated
并安装此更新版本:
ionic cordova plugin add https://github.com/ishan123456789/cordova-plugin-fcm-with-dependecy-updated.git
如果上述方法不适合您。困难的方式
在某些渠道中看到的上述问题的解决方案是:
转到plugins/cordova-plugin-fcm
或plugins/cordova-plugin-fcm-with-dependency-updated
,然后转到src/android/FCMPlugin.gradle
然后替换:
classpath 'com.google.gms:google-services:3.1.+'
使用
classpath 'com.google.gms:google-services:4.1.0'
核心:
dependencies {
compile 'com.google.firebase:firebase-core:11.8.0'
}
还有plugin.xml
<framework src="com.google.firebase:firebase-core:11.8.0" />
<framework src="com.google.firebase:firebase-messaging:11.8.0" />
替换已按照Google服务的更高版本进行。在我的情况下,冲突与google plus插件有关,所以我去了plugins/cordova-plugin-googleplus
,那里的google服务版本是
<preference name="PLAY_SERVICES_VERSION" default="11.8.0"/>
<framework src="com.google.android.gms:play-services-auth:$PLAY_SERVICES_VERSION" />
<framework src="com.google.android.gms:play-services-identity:$PLAY_SERVICES_VERSION" />
因此,版本11.8.0
从这里出现。
https://github.com/EddyVerbruggen/cordova-plugin-googleplus/issues/283
https://github.com/fechanique/cordova-plugin-fcm/issues/231
Google Play Services GCM 10.0.1 asks to “update” back to 9.0.0
https://github.com/fechanique/cordova-plugin-fcm/issues/499
https://github.com/fechanique/cordova-plugin-fcm/issues/306
此答案非常有用
com.google.android.gms:play-services-measurement-base is being requested by various other libraries