fechanique / cordova-plugin-fcm

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

com/google/gms/googleservices/GoogleServicesPlugin : Unsupported major.minor version 51.0 #116

Open arivanbastos opened 7 years ago

arivanbastos commented 7 years ago

I'm getting this error when trying to build for Android:

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Projetos\condo-class\platforms\android\build.gradle' line: 91

* What went wrong:
A problem occurred evaluating root project 'android'.
> 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

I already have installed the following libraries: Android Support Repository 38, Android Support Library 23.2.1, Google Play Services 32 and Google Repository 32. Also, I tried this solution https://github.com/fechanique/cordova-plugin-fcm/issues/7 but the error remains.

My project.properties:

target=android-23
android.library.reference.1=CordovaLib
cordova.system.library.1=com.google.android.gms:play-services-gcm:9.0.2
cordova.system.library.2=com.google.android.gms:play-services-analytics:9.0.2
cordova.system.library.3=com.google.android.gms:play-services-location:9.0.2
cordova.gradle.include.1=cordova-plugin-fcm/condoclass-FCMPlugin.gradle

My FCPlugin.gradle

buildscript {
    repositories {
            jcenter()
            mavenLocal()
        }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.1.0'
        classpath 'com.google.gms:google-services:3.0.0'
    }
}
repositories {
            jcenter()
            mavenLocal()
        }
dependencies {
    compile 'com.google.firebase:firebase-core:9.2.0'
    compile 'com.google.firebase:firebase-messaging:9.2.0'
}

// 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

Stackoverflow post about this issue: http://stackoverflow.com/questions/39500463/cordova-fcm-plugin-google-services-plugin-unsupported-major-minor-version-51-0

rolinger commented 7 years ago

Did you ever resolve this? I too am having the same error when compiling my project.