【问题标题】:How to fix 'Google services version conflict (Maps / FCM)'如何修复“Google 服务版本冲突(地图/FCM)”
【发布时间】:2020-01-25 14:17:11
【问题描述】:

在此链接中添加谷歌地图插件后会出现问题 https://github.com/mapsplugin/ionic-googlemaps-quickdemo-v4

这个谷歌地图在 ios 中运行良好,但是当我尝试在 android 上运行它时 得到这个错误

[cordova] * What went wrong:
[cordova] Execution failed for task 
':app:processDebugGoogleServices'.
[cordova] > 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.+.
[cordova] 
[cordova] * Try:
[cordova] Run with --stacktrace option to get the stack trace. Run 
with --info or --debug option to get more log output. Run with -- 
scan to get full insights.
[cordova] 
[cordova] * Get more help at https://help.gradle.org
[cordova] 
[cordova] BUILD FAILED in 38s
[ERROR] An error occurred while running subprocess cordova.

    cordova build android exited with exit code 1.

我尝试了所有这些解决方案,但对我不起作用,但对某人有用

1-https://forum.ionicframework.com/t/ionic-processdebuggoogleservices-version-conflict/132560

2-https://github.com/arnesson/cordova-plugin-firebase/issues/1093

3-https://forum.ionicframework.com/t/execution-failed-for-task-app-processdebuggoogleservices-please-fix-the-version-conflict-either-by-updating-the-version-of-the-google-services-plugin-version-of-com-google-android-gms-to-11-8-0/125610

4-https://forum.ionicframework.com/t/google-services-version-conflict-maps-fcm/93695/51

5-https://forum.ionicframework.com/t/google-services-version-conflict-maps-fcm/93695

【问题讨论】:

    标签: google-maps ionic-framework google-play-services ionic4 cordova-plugin-fcm


    【解决方案1】:

    出现问题是因为我使用的是 FCM 插件的旧版本,它在添加谷歌地图插件之前工作正常,因为 10.+ 和 15.0.1 不一样且不兼容而发生冲突。

       cordova.system.library.2=com.google.firebase:firebase-core:10.+
       cordova.system.library.3=com.google.firebase:firebase-messaging:10.+.
    

    cordova.system.library.4=com.google.android.gms:play-services-maps:15.0.1
    cordova.system.library.5=com.google.android.gms:play-services-location:15.0.1
    

    在这些步骤中,解决方案对我来说非常简单有趣

    1- 使用此命令卸载 fcm 插件。

    ionic cordova plugin rm cordova-plugin-fcm-with-dependecy-updated
    

    2-安装fcm插件

    ionic cordova plugin add cordova-plugin-fcm-with-dependecy-updated
    

    3- 移除安卓平台

    ionic cordova platform rm android
    

    4-添加安卓平台

    ionic cordova platform add android
    

    现在一切正常

    转到android平台并打开project.properties 你发现了变化 像这样

    cordova.system.library.2=com.google.firebase:firebase-core:16.0.9
    cordova.system.library.3=com.google.firebase:firebase-messaging:18.0.0 
    

    现在运行

    离子科尔多瓦运行安卓

    我希望对任何人都有帮助,谢谢。

    【讨论】:

    • 此解决方案在 ionic 4.12 中不起作用,我正在使用 Admb & FCM 插件。请帮忙....
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多