ionic项目使用Google FCM插件和Google maps插件打包android报错冲突问题

    这段时间在调FCM推送服务的插件 ,原本以为去年调通过,应该很容易,没想到还是出问题了。现将问题及解决方法整理如下,仅供参考:

    先看打包报错截图:        

    详细报错信息: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.+.

    大概的意思就是说:我使用的google-services插件与google gms服务的版本冲突,需要升级以解决冲突;

    出现这个问题的原因在于:我的项目中使用cordova-plugin-geolocation(定位)和cordova-plugin-googlemaps(地图),这两个插件使用了google-services服务,而ionic官方推荐添加的ionic cordova plugin add            cordova-plugin-fcm-with-dependecy-updated与fcm相关的插件使用了google的gms服务,这两个服务在一起的时候,必须保证服务相关的包的兼容性;

    解决方案:1.在android/app/build.gradle中修改dependencies下

         implementation 'com.google.firebase:firebase-core:16.0.8'
         implementation 'com.google.firebase:firebase-messaging:17.5.0'

                      2.在android/cordova-plugin-fcm-with-dependecy-updated/Alpha-FCMPlugin.gradle中修改 dependencies下

          compile 'com.google.firebase:firebase-core:16.0.8'

                3.sync成功之后,build,问题解决。

转载于:https://www.cnblogs.com/robinw666/p/11368545.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值