I already have Ionic project that works on Android/iOS and need to add Push Notifications there.
some dependencies from package.json:
"@ionic-native/core": "^5.18.0",
"@ionic/angular": "^4.11.7",
"caniuse-lite": "^1.0.30001016",
"cordova-android": "^8.1.0",
"cordova-browser": "^6.0.0",
"cordova-ios": "^5.1.1",
"firebase": "^7.24.0",
"ionic-native": "^2.9.0",
and info :
Ionic:
Ionic CLI : 6.12.4 (/home/user/.nvm/versions/node/v10.18.0/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 4.11.7
@angular-devkit/build-angular : 0.801.3
@angular-devkit/schematics : 8.1.3
@angular/cli : 8.1.3
@ionic/angular-toolkit : 2.1.1
Cordova:
Cordova CLI : 10.0.0
Cordova Platforms : android 8.1.0
Cordova Plugins : cordova-plugin-ionic-webview 4.1.3, (and 9 other plugins)
Utility:
cordova-res : not installed
native-run : 1.3.0
Android project.properties:
target=android-28
android.library.reference.1=CordovaLib
android.library.reference.2=app
cordova.system.library.1=com.android.support:support-v4:27.+
cordova.system.library.2=com.android.support:support-annotations:27.+
cordova.gradle.include.1=cordova-plugin-fcm-with-dependecy-updated/projectname-FCMPlugin.gradle
\app\buid.gradle\
apply plugin: 'com.android.application'
buildscript {
repositories {
mavenCentral()
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
}
}
allprojects {
repositories {
mavenCentral()
jcenter()
}
}
task wrapper(type: Wrapper) {
gradleVersion = '4.10.3'
}
...
ProjectBuilder.js:
var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'https\\://services.gradle.org/distributions/gradle-4.10.3-all.zip';
In Firebase console I have added Android project and donwload google-services.json to project root, then
ionic cordova plugin add cordova-plugin-fcm-with-dependecy-updated
As state in some guides for adding FCM into ionic project there also need add ionic-native/fcm
:
npm install @ionic-native/fcm
but here GitHub - andrehtissot/cordova-plugin-fcm-with-dependecy-updated: Google FCM Push Notifications Cordova Plugin script for uninstall this:
npm uninstall @ionic-native/fcm # Ionic support is included and conflicts with @ionic-native's implementation.
So I’m trying with and w/o the ionic-native/fcm
now I have:
> cordova build android --device
[cordova]
[cordova] FAILURE: Build failed with an exception.
[cordova]
[cordova] * What went wrong:
[cordova] A problem occurred configuring project ':app'.
[cordova] > Could not create task ':app:processDebugGoogleServices'.
[cordova] > Cannot create a proxy class for abstract class 'GoogleServicesTask'.
...
any help/suggestions would be appreciated!