Иони c 5: Не могу использовать плагин FCM: Google Firebase Cloud Messaging Cordova Pu sh Плагин - PullRequest
0 голосов
/ 23 февраля 2020

Я пытался создать приложение Ioni c для Android, но оно всегда заканчивается неудачей. Причиной моего несчастья является плагин FCM: https://ionicframework.com/docs/native/fcm

→ Google Firebase Cloud Messaging Cordova Pu sh Плагин https://github.com/andrehtissot/cordova-plugin-fcm-with-dependecy-updated

Это моя конфигурация Ioni c:

Ionic:

   Ionic CLI                     : 5.4.16 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 5.0.0
   @angular-devkit/build-angular : 0.803.23
   @angular-devkit/schematics    : 8.1.3
   @angular/cli                  : 8.1.3
   @ionic/angular-toolkit        : 2.1.2

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : android 8.1.0, ios 5.1.1
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.1.3, (and 15 other plugins)

Utility:

   cordova-res : not installed
   native-run  : not installed

System:

   Android SDK Tools : 26.1.1 (/Users/jonathan/Library/Android/sdk)
   ios-deploy        : 1.9.4
   ios-sim           : 8.0.2
   NodeJS            : v12.14.1 (/usr/local/bin/node)
   npm               : 6.13.4
   OS                : macOS Catalina
   Xcode             : Xcode 11.3.1 Build version 11C504

Это моя версия Gradle:

------------------------------------------------------------
Gradle 6.2
------------------------------------------------------------

Build time:   2020-02-17 08:32:01 UTC
Revision:     61d3320259a1a0d31519bf208eb13741679a742f

Kotlin:       1.3.61
Groovy:       2.5.8
Ant:          Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM:          13.0.2 (Oracle Corporation 13.0.2+8)
OS:           Mac OS X 10.15.3 x86_64

Это информация о моей Android Studio:

enter image description here

И это:

enter image description here

Когда я пытаюсь построить свой ioni c Проект без плагина FCM У меня нет никаких ошибок, но когда я добавляю этот плагин, я получаю следующие ошибки:

WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
FCM PLUGIN GRADLE TOOLS VERSION: 3.5.0registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

> Task :app:preBuild UP-TO-DATE
> Task :CordovaLib:preBuild UP-TO-DATE
> Task :CordovaLib:preDebugBuild UP-TO-DATE
> Task :CordovaLib:checkDebugManifest UP-TO-DATE
> Task :CordovaLib:processDebugManifest UP-TO-DATE

> Task :app:preDebugBuild FAILED
Dependency resolved to an incompatible version: Dependency(fromArtifactVersion=ArtifactVersion(groupId=com.google.android.gms, artifactId=play-services-clearcut, version=11.0.4), toArtifact=Artifact(groupId=com.google.android.gms, artifactId=play-services-tasks), toArtifactVersionString=[11.0.4])

FAILURE: Build failed with an exception.

* What went wrong:
Failed to capture fingerprint of input files for task ':app:preDebugBuild' property 'compileManifests' during up-to-date check.
> In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[11.0.
  4]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.

  Dependency failing: com.google.android.gms:play-services-clearcut:11.0.4 -> com.google.android.gms:play-services-tasks@[
  11.0.4], but play-services-tasks version was 16.0.1.

  The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art
  ifact with the issue.
  -- Project 'app' depends onto com.google.android.gms:play-services-clearcut@11.0.4
  -- Project 'app' depends onto com.google.android.gms:play-services-safetynet@11.0.4
  -- Project 'app' depends onto com.google.firebase:firebase-analytics@16.5.0
  -- Project 'app' depends onto com.google.firebase:firebase-core@16.0.9
  -- Project 'app' depends onto com.google.android.gms:play-services-base@11.0.4
  -- Project 'app' depends onto com.google.firebase:firebase-messaging@18.0.0
  -- Project 'app' depends onto com.google.firebase:firebase-iid@18.0.0
  -- Project 'app' depends onto com.google.android.gms:play-services-ads@11.0.4
  -- Project 'app' depends onto com.google.android.gms:play-services-tasks@16.0.1
  -- Project 'app' depends onto com.google.android.gms:play-services-base@16.0.1
  -- Project 'app' depends onto com.google.firebase:firebase-common@17.0.0
  -- Project 'app' depends onto com.google.firebase:firebase-iid-interop@16.0.1
  -- Project 'app' depends onto com.google.android.gms:play-services-measurement-api@16.5.0

  For extended debugging info execute Gradle from the command line with ./gradlew --info :app:assembleDebug to see the dep
  endency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https://
  github.com/google/play-services-plugins and disable by adding "googleServices { disableVersionCheck = false }" to your b
  uild.gradle file.

* Try:
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.

* Get more help at https://help.gradle.org

BUILD FAILED in 8s
3 actionable tasks: 1 executed, 2 up-to-date
Command finished with error code 1: /Users/jonathan/Desktop/projects/clients/findlover/platforms/android/gradlew cdvBuildDebug,-b,/Users/jonathan/Desktop/projects/clients/findlover/platforms/android/build.gradle
/Users/jonathan/Desktop/projects/clients/findlover/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
Failed to capture fingerprint of input files for task ':app:preDebugBuild' property 'compileManifests' during up-to-date check.
> In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[11.0.
  4]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.

  Dependency failing: com.google.android.gms:play-services-clearcut:11.0.4 -> com.google.android.gms:play-services-tasks@[
  11.0.4], but play-services-tasks version was 16.0.1.

  The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art
  ifact with the issue.
  -- Project 'app' depends onto com.google.android.gms:play-services-clearcut@11.0.4
  -- Project 'app' depends onto com.google.android.gms:play-services-safetynet@11.0.4
  -- Project 'app' depends onto com.google.firebase:firebase-analytics@16.5.0
  -- Project 'app' depends onto com.google.firebase:firebase-core@16.0.9
  -- Project 'app' depends onto com.google.android.gms:play-services-base@11.0.4
  -- Project 'app' depends onto com.google.firebase:firebase-messaging@18.0.0
  -- Project 'app' depends onto com.google.firebase:firebase-iid@18.0.0
  -- Project 'app' depends onto com.google.android.gms:play-services-ads@11.0.4
  -- Project 'app' depends onto com.google.android.gms:play-services-tasks@16.0.1
  -- Project 'app' depends onto com.google.android.gms:play-services-base@16.0.1
  -- Project 'app' depends onto com.google.firebase:firebase-common@17.0.0
  -- Project 'app' depends onto com.google.firebase:firebase-iid-interop@16.0.1
  -- Project 'app' depends onto com.google.android.gms:play-services-measurement-api@16.5.0

  For extended debugging info execute Gradle from the command line with ./gradlew --info :app:assembleDebug to see the dep
  endency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https://
  github.com/google/play-services-plugins and disable by adding "googleServices { disableVersionCheck = false }" to your b
  uild.gradle file.

* Try:
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.

* Get more help at https://help.gradle.org

BUILD FAILED in 8s
Error: /Users/jonathan/Desktop/projects/clients/findlover/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
Failed to capture fingerprint of input files for task ':app:preDebugBuild' property 'compileManifests' during up-to-date check.
> In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[11.0.
  4]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.

  Dependency failing: com.google.android.gms:play-services-clearcut:11.0.4 -> com.google.android.gms:play-services-tasks@[
  11.0.4], but play-services-tasks version was 16.0.1.

  The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art
  ifact with the issue.
  -- Project 'app' depends onto com.google.android.gms:play-services-clearcut@11.0.4
  -- Project 'app' depends onto com.google.android.gms:play-services-safetynet@11.0.4
  -- Project 'app' depends onto com.google.firebase:firebase-analytics@16.5.0
  -- Project 'app' depends onto com.google.firebase:firebase-core@16.0.9
  -- Project 'app' depends onto com.google.android.gms:play-services-base@11.0.4
  -- Project 'app' depends onto com.google.firebase:firebase-messaging@18.0.0
  -- Project 'app' depends onto com.google.firebase:firebase-iid@18.0.0
  -- Project 'app' depends onto com.google.android.gms:play-services-ads@11.0.4
  -- Project 'app' depends onto com.google.android.gms:play-services-tasks@16.0.1
  -- Project 'app' depends onto com.google.android.gms:play-services-base@16.0.1
  -- Project 'app' depends onto com.google.firebase:firebase-common@17.0.0
  -- Project 'app' depends onto com.google.firebase:firebase-iid-interop@16.0.1
  -- Project 'app' depends onto com.google.android.gms:play-services-measurement-api@16.5.0

  For extended debugging info execute Gradle from the command line with ./gradlew --info :app:assembleDebug to see the dep
  endency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https://
  github.com/google/play-services-plugins and disable by adding "googleServices { disableVersionCheck = false }" to your b
  uild.gradle file.

* Try:
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.

* Get more help at https://help.gradle.org

BUILD FAILED in 8s
    at ChildProcess.whenDone (/Users/jonathan/Desktop/projects/clients/findlover/node_modules/cordova-common/src/superspawn.js:135:23)
    at ChildProcess.emit (events.js:223:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Socket.<anonymous> (internal/child_process.js:430:11)
    at Socket.emit (events.js:223:5)
    at Pipe.<anonymous> (net.js:664:12)
[ERROR] An error occurred while running subprocess cordova.

        cordova build android --verbose exited with exit code 1.

        Re-running this command with the --verbose flag may provide more information.
  ionic:utils-process onBeforeExit handler: 'process.exit' received +0ms
  ionic:utils-process onBeforeExit handler: running 2 functions +0ms
  ionic:utils-process processExit: exiting (exit code: 1) +49ms

Я создаю видео об этом на YouTube:

https://youtu.be/sXod7xCDs8c

Вы можете видеть на этом видео. Я могу построить свой проект без плагина FCM. Я уже проверяю это topi c: после установки ioni c. Плагин Cordova добавляет Cordova-плагин-FCM-с-зависимостью-обновлен мой android встроенный не работает

Моя проблема не только в этом Ма c. У меня другой компьютер Ma c, и все время появляется одна и та же ошибка.

Я новичок в Android. У меня нет контроля над конфигурацией файлов Android. В чем причина моей ошибки?

1 Ответ

0 голосов
/ 23 февраля 2020

Оригинальный плагин, к сожалению, не поддерживается активно, и в зависимости от версии вашего фреймворка и т. Д. c это может вызвать много проблем.

Был какой-то форк этого плагина, сделанный некоторое время go и эта разветвленная версия имеет довольно приличную поддержку и покрытие тестами:

https://github.com/andrehtissot/cordova-plugin-fcm-with-dependecy-updated#readme

Я использую этот плагин вместо исходного и пока что он работает без нареканий.

...