You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

升级Cordova及Firebasex插件后出现FirebasePlugin未定义前置错误

FirebasePlugin is not defined 错误在Cordova 12 + Android 13 + cordova-plugin-firebasex 18.0.7中复发

背景与问题

此前我的应用使用Cordova@11、Cordova-Android@11.1搭配cordova-plugin-firebasex@16.0.5版本,生产/应用商店版本运行完全正常。

升级开发环境至Cordova@12、Cordova-Android@13及最新版cordova-plugin-firebasex@18.0.7,同时升级少量其他插件后,在本地设备或模拟器上构建并启动应用时,DeviceReady事件触发前会出现FirebasePlugin is not defined错误。点击控制台错误定位到FirebasePlugin._onAuthIdTokenChange(),对应VM3:1(表明该代码由插件内部生成)。

问题判断

  • 确认是cordova-plugin-firebasex的问题:未使用任何直接依赖FirebasePlugin的其他插件
  • 该问题曾在cordova-plugin-firebasex@17版本中修复,当前v18.0.7版本保留了该修复代码,但问题似乎复发
  • 插件开发者@dpa99c维护积极,但目前社区无相同反馈,已提交issue未获回复

已安装的其他插件列表

com-sarriaroman-photoviewer 1.3.0 "PhotoViewer"
com.peerio.cordova.plugin.carrier 1.0.1 "Carrier"
cordova-clipboard 1.3.0 "Clipboard"
cordova-custom-config 5.1.1 "cordova-custom-config"
cordova-launch-review 4.1.3 "Launch Review"
cordova-open-native-settings 1.5.6 "Native settings"
cordova-plugin-android-notch 1.0.0 "AndroidNotch"
cordova-plugin-appavailability 0.4.2 "AppAvailability"
cordova-plugin-appinfo 2.1.2 "AppInfo Plugin"
cordova-plugin-console 1.1.0 "Console"
cordova-plugin-customurlscheme 5.0.3 "Custom URL scheme"
cordova-plugin-deeplinks 1.1.1 "Cordova Deeplinks Plugin"
cordova-plugin-device 3.0.0 "Device"
cordova-plugin-deviceinformation 2.0.2 "DeviceInformation"
cordova-plugin-dialogs 2.0.2 "Notification"
cordova-plugin-enable-multidex 0.2.0 "Enable Multidex"
cordova-plugin-file 8.1.3 "File"
cordova-plugin-file-downloader 0.4.0 "Downloader"
cordova-plugin-file-md5 0.3.3 "MD5 Checksum"
cordova-plugin-file-opener2 4.0.0 "File Opener2"
cordova-plugin-file-transfer 2.0.0 "File Transfer"
cordova-plugin-geolocation 5.0.0 "Geolocation"
cordova-plugin-inappbrowser 6.0.0 "InAppBrowser"
cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 5.0.0 "cordova-plugin-ionic-webview"
cordova-plugin-network-information 3.0.0 "Network Information"
cordova-plugin-qrscanner-11 3.0.5 "QRScanner"
cordova-plugin-request-location-accuracy 2.3.0 "Request Location Accuracy"
cordova-plugin-screensize 1.3.1 "screensize"
cordova-plugin-sim 1.3.3 "SIM"
cordova-plugin-splashscreen 6.0.2 "Splashscreen"
cordova-plugin-statusbar 4.0.0 "StatusBar"
cordova-plugin-vibration 3.1.1 "Vibration"
cordova-plugin-zip 3.1.0 "cordova-plugin-zip"
cordova-sms-plugin 1.0.4 "Cordova SMS Plugin"
cordova.plugins.diagnostic 7.2.3 "Diagnostic"

关键注意事项

  • 应用基础代码中从未引用FirebasePlugin._onAuthIdTokenChange(),错误肯定来自插件内部
  • 错误仅在约50%的启动次数中触发,属于偶发问题
  • 错误触发后,后续FirebasePlugin可正常引用且插件功能完全正常,但担心该问题影响应用商店提交,特此求助

内容的提问来源于stack exchange,提问作者rolinger

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.12 19:07:38