首页 > 解决方案 > ionic4 和 firebase 推送通知问题

问题描述

我在构建应用程序时遇到以下错误:错误:请通过更新 google-services 插件的版本来修复版本冲突(有关最新版本的信息,请访问https://bintray.com/android/android-tools /com.google.gms.google-services/)或将 com.google.android.gms 的版本更新到 10.+。

在我的 android 应用程序中,我有以下依赖项:

电容器.build.gradle:

implementation "com.google.firebase:firebase-core:10.+"
    implementation "com.google.firebase:firebase-messaging:10.+"
    implementation "com.google.android.gms:play-services-location:16.+"

电容器.build.gradle:

implementation 'com.google.firebase:firebase-messaging:18.0.0'

构建.gradle:

try {
    def servicesJSON = file('google-services.json')
    if (servicesJSON.text) {
        apply plugin: 'com.google.gms.google-services'
    }
} catch(Exception e) {
    logger.warn("google-services.json not found, google-services plugin not applied. Push Notifications won't work")
}

标签: androidfirebaseionic-frameworkionic4ionic-native

解决方案


推荐阅读