I'm trying to create an Ionic application with firebase native plugin.
First step I create my ionic app :
ionic start
Then I add firebase plugin:
ionic cordova plugin add cordova-plugin-firebase
npm install @ionic-native/firebase
After that I try to add android platform :
ionic cordova build android
And I have this error :
> Task :app:fabricGenerateResourcesDebug FAILED
ERROR - Crashlytics Developer Tools error.
java.lang.IllegalArgumentException: Crashlytics found an invalid API key: null.
My plugin list cordova plugin list
:
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-firebase 2.0.5 "Google Firebase Plugin"
cordova-plugin-ionic-keyboard 2.1.3 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 4.1.1 "cordova-plugin-ionic-webview"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"
If I use android studio, I have the same error : Crashlytics found an invalid API key: null.
So I used this post : Crashlytics found an invalid API key - AndroidStudio build
After that I get this error : error: cannot find symbol class NotificationManagerCompat.
So I have added the dependency implementation 'com.android.support:support-compat:27.+'
to builde.gradle of my application.
But I'm still facing 2 errors :
#android/app/src/main/java/org/apache/cordova/firebase/FirebasePlugin.java
error: method getByteArray in class FirebaseRemoteConfig cannot be applied to given types;
required: String
found: String,String
reason: actual and formal argument lists differ in length
#android/app/src/main/java/org/apache/cordova/firebase/FirebasePluginInstanceIDService.java
error: cannot find symbol class FirebaseInstanceIdService
error: method does not override or implement a method from a supertype
How I can get an ionic app working with firebase (firestore, auth and cloud messaging) ?
Thanks for your help.