【发布时间】:2019-07-13 09:19:18
【问题描述】:
我正在尝试使用 firebase 原生插件创建一个 Ionic 应用程序。
第一步我创建我的离子应用程序:
ionic start
然后我添加firebase插件:ionic cordova plugin add cordova-plugin-firebase
npm install @ionic-native/firebase
之后我尝试添加 android 平台:
ionic cordova build android
我有这个错误:
> Task :app:fabricGenerateResourcesDebug FAILED
ERROR - Crashlytics Developer Tools error.
java.lang.IllegalArgumentException: Crashlytics found an invalid API key: null.
我的插件列表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"
如果我使用 android studio,我也会遇到同样的错误: Crashlytics 发现了一个无效的 API 密钥:null。
所以我使用了这个帖子:Crashlytics found an invalid API key - AndroidStudio build
之后我收到此错误:错误:找不到符号类 NotificationManagerCompat。
所以我在我的应用程序的 builde.gradle 中添加了依赖 implementation 'com.android.support:support-compat:27.+'。
但我仍然面临 2 个错误:
#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
如何让 ionic 应用与 firebase(firestore、auth 和云消息传递)一起使用?
感谢您的帮助。
【问题讨论】:
标签: android firebase cordova ionic-framework