fechanique / cordova-plugin-fcm

Google FCM Push Notifications Cordova Plugin
624 stars 991 forks source link

Build Failed Ionic 4 #611

Open pwronline opened 4 years ago

pwronline commented 4 years ago

Hi! I'm having problems implementing FCM in ionic 4

$ ionic cordova plugin add cordova-plugin-fcm-with-dependecy-updated $ npm install @ionic-native/fcm

$ ionic cordova run android --prod

BUILD FAILED in 7s

Task :app:mainApkListPersistenceDebug Task :app:generateDebugResValues Task :app:generateDebugResources

Task :app:processDebugGoogleServices FAILED Found com.google.android.gms:play-services-maps:15.0.1, but version 16.0.9 is needed for the google-services plugin. Found com.google.android.gms:play-services-location:15.0.1, but version 16.0.9 is needed for the google-services plugin. 20 actionable tasks: 20 executed D:\ionic\nativum\platforms\android\gradlew: Command failed with exit code 1 Error output: Note: D:\ionic\nativum\platforms\android\CordovaLib\src\org\apache\cordova\engine\SystemCookieManager.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:processDebugGoogleServices'.

    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 16.0.9.

  • 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 7s

Ionic:

ionic (Ionic CLI) : 4.12.0 (C:\Users\el_hi\AppData\Roaming\npm\node_modules\ionic) Ionic Framework : @ionic/angular 4.8.1 @angular-devkit/build-angular : 0.13.9 @angular-devkit/schematics : 7.3.9 @angular/cli : 7.3.9 @ionic/angular-toolkit : 1.5.1

Capacitor:

capacitor (Capacitor CLI) : 1.1.1 @capacitor/core : 1.0.0-beta.11

Cordova:

cordova (Cordova CLI) : 9.0.0 (cordova-lib@9.0.1) Cordova Platforms : android 8.0.0, browser 6.0.0 Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.1.2, (and 12 other plugins)

System:

(C:\Program Files (x86)\Android\android-sdk) NodeJS : v8.11.2 (C:\Program Files\nodejs\node.exe) npm : 5.6.0 OS : Windows 10

guigons commented 4 years ago

+1

JCrAg commented 4 years ago

Same here. Did you find a solution?

pwronline commented 4 years ago

i have a temporaly solution for this problem.

Archive /plugins/cordova-plugin-fcm-with-dependecy-updated/src/android/FCMPlugin.gradle

JCrAg commented 4 years ago

Thank you very much pwronline, it works perfectly!