添加FCM插件后的Google Services版本冲突:ionic 3

时间:2018-09-19 07:25:17

标签: cordova firebase ionic-framework ionic3 google-play-services

我尝试使用FCM插件,但是我的想法全部失败了:

案例1:我使用cordova-google-plus插件添加了cordova-plugin-fcm-with-dependecy-updated,这导致Cordova构建失败:

screenshot

案例2:我评论了fcmplugin.gradle文件中的以下几行

classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.google.gms:google-services:4.1.0'   
apply plugin: 'com.google.gms.googleservices.GoogleServicesPlugin'

然后我在项目build.gradle中添加了以下几行

classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.google.gms:google-services:4.1.0'
apply plugin: 'com.google.gms.google-services' at the bottom of build.gradle

Cordova构建成功,但应用程序未在设备/模拟器上运行(“应用程序已停止”)。

我的应用中使用的插件

enter image description here

1 个答案:

答案 0 :(得分:0)

请删除删除android平台 在FCMPlugin.gradle(插件文件夹)上,像这样编辑:

classpath 'com.google.gms:google-services:4.1.0'
compile 'com.google.firebase:firebase-core:11.0.4'

然后在plugin.xml文件中

<framework src="com.google.firebase:firebase-core:11.0.4" />
<framework src="com.google.firebase:firebase-messaging:11.0.4" />