Search code examples
cordovaionic-frameworkpush-notificationcordova-pluginsfirebase-cloud-messaging

Cordova FCM Plugin - Google Services Plugin Unsupported major.minor version 51.0


I'm following instructions from https://github.com/fechanique/cordova-plugin-fcm to use FCM plugin in my ionic 1 project, but I'm get in trouble.

When I run "ionic run android" I get:

> Could not open dsl remapped class cache for 90dph5obcol5uraf1d1h262ym (C:\Users\arivan\.gradle\caches\2.13\scripts-remapped\condoclass_FCMPlugin_auvalosjdpfzmwa03yh9kenur\90dph5obcol5uraf1d1h262ym\dsl-1812427186).
   > Could not open dsl generic class cache for script 'C:\Projetos\condo-class\platforms\android\cordova-plugin-fcm\condoclass-FCMPlugin.gradle' (C:\Users\arivan\.gradle\caches\2.13\scripts\90dph5obcol5uraf1d1h262ym\dsl\dsl-1812427186).
      > com/google/gms/googleservices/GoogleServicesPlugin : Unsupported major.minor version 51.0

If I comment line

apply plugin: com.google.gms.googleservices.GoogleServicesPlugin

in platforms\android\cordova-plugin-fcm\MyProject-FCMPlugin.gradle file, the build process runs succesfully, but my app crashs on startup.

Following is my project plugin list:

com.telerik.plugins.nativepagetransitions 0.6.5 "Native Page Transitions"
com.telerik.plugins.wkwebview 0.6.9 "WKWebView Polyfill"
cordova-plugin-compat 1.0.0 "Compat"
cordova-plugin-console 1.0.3 "Console"
cordova-plugin-device 1.1.2 "Device"
cordova-plugin-fcm 1.1.4 "FCMPlugin"
cordova-plugin-file 4.2.0 "File"
cordova-plugin-file-transfer 1.5.1 "File Transfer"
cordova-plugin-inappbrowser 1.4.0 "InAppBrowser"
cordova-plugin-splashscreen 3.2.2 "Splashscreen"
cordova-plugin-statusbar 2.1.3 "StatusBar"
cordova-plugin-whitelist 1.2.2 "Whitelist"
ionic-plugin-keyboard 2.2.1 "Keyboard"

Following is my Android SDK Manager "Extras" section:

enter image description here

What is wrong?


Solution

  • Check out this issue link.

    You may have to tweak in project.properties and FCMPlugin.gradle as mentioned in the link.

    In project.properties add,

    cordova.system.library.2=com.google.android.gms:play-services-gcm:9.0.2 cordova.system.library.3=com.google.android.gms:play-services-analytics:9.0.2 cordova.system.library.4=com.google.android.gms:play-services-location:9.0.2

    In FCMPlugin.gradle,

    dependencies { compile 'com.google.firebase:firebase-core:9.0.2' compile 'com.google.firebase:firebase-messaging:9.0.2' }

    project.properties file is under platforms/android/ directory.

    Hope it helps