0

错误:任务“:processDebugGoogleServices”执行失败。

请通过更新 google-services 插件的版本来修复版本冲突(有关最新版本的信息可在https://bintray.com/android/android-tools/com.google.gms.google-services/获得)或将 com.google.android.gms 的版本更新为 10.+。

我想要离子cordova插件cordova-plugin-fcm-with-dependecy-updated用于通知但安装此插件后构建崩溃如果我删除此插件然后我的应用程序正在运行

我尝试使用带有cordova-plugin-googleplus 7.0.0 的android 8.0.0 的fcm 插件,我尝试使用带有cordova-plugin-googleplus 5.2.1 的android 7.4.1 和6.4.0

4

3 回答 3

2

尝试这个!..

步骤1ionic cordova platform rm android

步骤 2 转到/plugins/cordova-plugin-fcm-with-dependecy-updated/src/android/FCMPlugin.gradle

像这样改变

buildscript {
    repositories {
        mavenCentral()
        jcenter()
        mavenLocal()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.+'
        classpath 'com.google.gms:google-services:3.1.+'
    }
}
repositories {
    mavenCentral()
    jcenter()
}
dependencies {
    compile 'com.google.firebase:firebase-core:11.4.2'
}
// apply plugin: 'com.google.gms.google-services'
// class must be used instead of id(string) to be able to apply plugin from non-root gradle file
apply plugin: com.google.gms.googleservices.GoogleServicesPlugin

第 3 步ionic cordova platform add android

步骤 4 转到/platforms/android/project.properties

像数字一样更改为 11.4.2

cordova.system.library.3=com.google.firebase:firebase-core:11.4.2
cordova.system.library.4=com.google.firebase:firebase-messaging:11.4.2
cordova.system.library.7=com.google.android.gms:play-services-auth:11.4.2
cordova.system.library.8=com.google.android.gms:play-services-identity:11.4.2

演示项目.properties 文件

# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
target=android-26
android.library.reference.1=CordovaLib
cordova.gradle.include.1=cordova-plugin-badge/mobile-badge.gradle
cordova.system.library.2=com.facebook.android:facebook-android-sdk:4.25.0
cordova.system.library.3=com.google.firebase:firebase-core:11.4.2
cordova.system.library.4=com.google.firebase:firebase-messaging:11.4.2
cordova.gradle.include.2=cordova-plugin-fcm-with-dependecy-updated/mobile-FCMPlugin.gradle
cordova.system.library.6=com.android.support:appcompat-v7:25.+
cordova.system.library.7=com.google.android.gms:play-services-auth:11.4.2
cordova.system.library.8=com.google.android.gms:play-services-identity:11.4.2
cordova.gradle.include.3=cordova-plugin-local-notification/mobile-localnotification.gradle
cordova.gradle.include.4=cordova-plugin-telerik-imagepicker/mobile-ignorelinterrors.gradle
cordova.gradle.include.5=cordova-plugin-telerik-imagepicker/mobile-androidtarget.gradle
cordova.gradle.include.6=phonegap-plugin-barcodescanner/mobile-barcodescanner.gradle
cordova.system.library.11=com.android.support:support-v4:27.+
cordova.gradle.include.7=twitter-connect-plugin/mobile-twitter.gradle
cordova.system.library.12=com.squareup.okhttp3:okhttp:3.12.0

第 5 步 ionic cordova 构建 android

Note :: Don't forgot to add google-services.json file in root directory, main_project/google-services.json
于 2019-05-11T15:11:22.843 回答
1

我们有同样的问题,昨天我们用这个答案解决了这个问题:

答案:1

这是由于 4 月 5 日的 firebase 更新。在这里https://firebase.google.com/support/release-notes/android#update_-_april_02_2019,我找到了最后的工作版本并相应地调整了我的 project.properties

cordova.system.library.4=com.google.firebase:firebase-core:16.0.8 
cordova.system.library.5=com.google.firebase:firebase-messaging:17.5.0 
cordova.system.library.6=com.google.firebase:firebase-config:16.4.1 
cordova.system.library.7=com.google.firebase:firebase-perf:16.2.4

在这里,所有依赖项都锁定到特定版本(更新 - 2019 年 4 月 2 日)而不是 +,这将使您获得最新版本,从而中断构建过程。

现在我可以成功构建了!我希望它有帮助!

参考:页面

答案:2

一个很棒的人在 cordova-firebase-plugin 官方 repo 中打开了一个 pull request 31 并且它有效。

我做的步骤:

1 - Remove cordova-firebase-plugin with ionic cordova plugin remove cordova- 
firebase-plugin

2 - Install: ionic cordova plugin add https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue

3 - rm -rf node_modules/ plugins/ platforms/android package-lock.json

4 - ionic cordova platform add android && npm install

5 - In my case, I also use a firebase js library in an old version because the newest ones are not working for me. With that library I always need to reinstall it manually after all the previous steps, so also I did: npm install firebase@4.12.1.

现在它正在工作。

参考:页面

于 2019-05-10T07:34:38.557 回答
0

我是与 Cordova 一起开发的韩国人

我解决了如下。cordova-plugin-admob-free 和库与 cordova-plugin-fcm-with-dependecy-updated 冲突。

我只更改了广告版本并运行它,如下所示。

我不确定内容是否会使用 Google 翻译提供。 在此处输入图像描述

/platforms/android/project.properties

cordova.system.library.1=com.google.firebase:firebase-core:16.0.9 cordova.system.library.2=com.google.firebase:firebase-messaging:18.0.0 cordova.gradle.include.1= cordova-plugin-fcm-with-dependecy-updated/helloworld-FCMPlugin.gradle cordova.system.library.3=com.google.android.gms:play-services-base:11.0.4 cordova.system.library.4= com.google.android.gms:play-services-ads:17.0.0

于 2020-03-16T15:10:27.077 回答