andrehtissot / cordova-plugin-fcm-with-dependecy-updated

Google FCM Push Notifications Cordova Plugin
MIT License
210 stars 273 forks source link

FCMPlugin: Support for Gradle v4 or lower is deprecated. Please upgrade to a newer version. in ionic 5 #222

Open kapilmyakal opened 3 years ago

kapilmyakal commented 3 years ago

FCMPlugin: Support for Gradle v4 or lower is deprecated. Please upgrade to a newer version. in ionic 5
automatically added in cordova plugin below code ,how to resolve in cordova 9 and higher on mobile it shows plugin not installed . cordova-plugin-fcm-with-dependecy-updated": { "ANDROID_DEFAULT_NOTIFICATION_ICON": "@mipmap/ic_launcher", "ANDROID_FCM_VERSION": "21.0.0", "ANDROID_FIREBASE_BOM_VERSION": "26.0.0", "ANDROID_GOOGLE_SERVICES_VERSION": "4.3.4", "ANDROID_GRADLE_TOOLS_VERSION": "4.1.0" } }, Package.json { "name": "eLabLogistics", "version": "0.0.1", "author": "Ionic Framework", "homepage": "https://ionicframework.com/", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { "@angular/common": "^11.0.5", "@angular/core": "^11.0.5", "@angular/fire": "^6.1.4", "@angular/forms": "^11.0.5", "@angular/platform-browser": "^11.0.5", "@angular/platform-browser-dynamic": "^11.0.5", "@angular/router": "^11.0.5", "@ionic-native/android-permissions": "^5.30.0", "@ionic-native/background-geolocation": "^5.30.0", "@ionic-native/camera": "^5.30.0", "@ionic-native/core": "^5.30.0", "@ionic-native/document-viewer": "^5.30.0", "@ionic-native/email-composer": "^5.30.0", "@ionic-native/fcm": "^5.30.0", "@ionic-native/file": "^5.30.0", "@ionic-native/file-opener": "^5.30.0", "@ionic-native/file-transfer": "^5.30.0", "@ionic-native/google-maps": "^5.5.0", "@ionic-native/in-app-browser": "^5.30.0", "@ionic-native/network": "^5.30.0", "@ionic-native/photo-viewer": "^5.30.0", "@ionic-native/splash-screen": "^5.30.0", "@ionic-native/status-bar": "^5.30.0", "@ionic/angular": "^5.5.2", "@ionic/storage": "^2.3.1", "cordova-android": "^9.0.0", "cordova-browser": "6.0.0", "cordova-plugin-androidx": "^3.0.0", "cordova-plugin-androidx-adapter": "^1.1.3", "cordova-plugin-dialogs": "^2.0.2", "cordova-plugin-document-viewer": "^0.9.13", "cordova-plugin-fcm-with-dependecy-updated": "^7.7.0", "cordova-plugin-file-opener2": "^3.0.5", "cordova-plugin-file-transfer": "^1.7.1", "cordova-plugin-googlemaps": "^2.7.1", "cordova-sqlite-storage": "5.1.0", "firebase": "^8.2.2", "moment": "^2.29.1", "rxjs": "^6.5.5", "tslib": "^2.0.0", "zone.js": "~0.10.3" }, "devDependencies": { "@angular-devkit/build-angular": "^0.1100.4", "@angular/cli": "^11.0.4", "@angular/compiler": "^11.0.5", "@angular/compiler-cli": "^11.0.5", "@angular/language-service": "^11.0.5", "@ionic/angular-toolkit": "^3.0.0", "@mauron85/cordova-plugin-background-geolocation": "^3.1.0", "@types/jasmine": "~3.5.0", "@types/jasminewd2": "~2.0.3", "@types/node": "^12.11.1", "codelyzer": "^6.0.0", "com-sarriaroman-photoviewer": "^1.2.5", "cordova-plugin-android-permissions": "^1.1.2", "cordova-plugin-camera": "^5.0.1", "cordova-plugin-device": "^2.0.2", "cordova-plugin-dialogs": "^2.0.2", "cordova-plugin-email-composer": "^0.9.2", "cordova-plugin-file": "^6.0.2", "cordova-plugin-googlemaps": "^2.7.1", "cordova-plugin-inappbrowser": "^4.1.0", "cordova-plugin-ionic-keyboard": "^2.2.0", "cordova-plugin-ionic-webview": "^4.2.1", "cordova-plugin-network-information": "^2.0.2", "cordova-plugin-splashscreen": "^5.0.2", "cordova-plugin-statusbar": "^2.4.2", "cordova-plugin-whitelist": "^1.3.3", "jasmine-core": "~3.5.0", "jasmine-spec-reporter": "~5.0.0", "karma": "~5.0.0", "karma-chrome-launcher": "~3.1.0", "karma-coverage-istanbul-reporter": "~3.0.2", "karma-jasmine": "~3.3.0", "karma-jasmine-html-reporter": "^1.5.0", "protractor": "~7.0.0", "ts-node": "~8.3.0", "tslint": "~6.1.0", "typescript": "~4.0.5" }, "description": "An Ionic project", "cordova": { "plugins": { "cordova-plugin-whitelist": {}, "cordova-plugin-statusbar": {}, "cordova-plugin-device": {}, "cordova-plugin-splashscreen": {}, "cordova-plugin-ionic-webview": { "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "28.+" }, "cordova-plugin-ionic-keyboard": {}, "cordova-plugin-network-information": {}, "cordova-sqlite-storage": {}, "cordova-plugin-email-composer": { "ANDROID_SUPPORT_V4_VERSION": "27.+" }, "cordova-plugin-camera": { "ANDROID_SUPPORT_V4_VERSION": "28.+" }, "cordova-plugin-file": {}, "cordova-plugin-file-transfer": {}, "cordova-plugin-file-opener2": { "ANDROID_SUPPORT_V4_VERSION": "27.+" }, "cordova-plugin-document-viewer": {}, "cordova-plugin-inappbrowser": {}, "cordova-plugin-googlemaps": {}, "com-sarriaroman-photoviewer": {}, "cordova-plugin-android-permissions": {}, "cordova-plugin-androidx-adapter": {}, "cordova-plugin-androidx": {}, "cordova-plugin-fcm-with-dependecy-updated": { "ANDROID_DEFAULT_NOTIFICATION_ICON": "@mipmap/ic_launcher", "ANDROID_FCM_VERSION": "21.0.0", "ANDROID_FIREBASE_BOM_VERSION": "26.0.0", "ANDROID_GOOGLE_SERVICES_VERSION": "4.3.4", "ANDROID_GRADLE_TOOLS_VERSION": "4.1.0" } }, "platforms": [ "browser", "android" ] } }

kapilmyakal commented 3 years ago

Native: tried calling FCM.onNotification, but the FCM plugin is not installed. Install the FCM plugin: 'ionic cordova plugin add cordova-plugin-fcm-with-dependecy-updated'

nabilsadki commented 3 years ago

Same problem

rsanahi commented 3 years ago

platforms\android\cordova\lib\builders\ProjectBuilder.js

var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'https\://services.gradle.org/distributions/gradle-4.1.1-all.zip';

to

var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'https\://services.gradle.org/distributions/gradle-5.6.4-all.zip';

nabilsadki commented 3 years ago

Solved by downgrading the plugin to 7.0.1

tiagotrigger commented 3 years ago

I downgrade my version as well (using 7.0.8)

poppywood commented 3 years ago

Worked for me up to and including release 7.6.1 (cordova latest). Release 7.7.0 onwards seems to lead this error

Civile commented 2 years ago

Solved by downgrading the plugin to 7.0.1

For me as well, solved by downgrading the Plugin to 7.0.1. Ionic version is 5.4.16 and Gradle version 7.2

shravanvis commented 1 year ago

how do you downgrade gradle version