Yal*_*eee 0 ios firebase firebase-authentication flutter firebase-cloud-messaging
我的 Flutter 应用程序已更新到最新版本的 Flutter,并且我将 firebase_messaging 添加到我的应用程序中。完成此操作后,该应用程序在模拟器上运行良好,但当我尝试在实际 iOS 设备上运行它时崩溃,并出现以下错误:
-[NSNull length]: unrecognized selector sent to instance 0x1ddcb9ee0
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull length]: unrecognized selector sent to instance 0x1ddcb9ee0'
*** First throw call stack:
(0x18c8959d8 0x1a0bfeb54 0x18c7a5bbc 0x18c89801c 0x18c899f8c 0x102deadcc 0x102dec698 0x102deb1a8 0x102dea8bc 0x18c4cd298 0x18c4ce280 0x18c4aa4f0 0x18c4aafdc 0x18c4b4800 0x1d4f3b5a4 0x1d4f3e874)
libc++abi.dylib: terminating with uncaught exception of type NSException
* thread #5, queue = 'com.google.firebase.auth.globalWorkQueue', stop reason = signal SIGABRT
frame #0: 0x00000001b86f484c libsystem_kernel.dylib`__pthread_kill + 8
libsystem_kernel.dylib`__pthread_kill:
-> 0x1b86f484c <+8>: b.lo 0x1b86f4868 ; <+36>
0x1b86f4850 <+12>: stp x29, x30, [sp, #-0x10]!
0x1b86f4854 <+16>: mov x29, sp
0x1b86f4858 <+20>: bl 0x1b86d1f5c ; cerror_nocancel
Target 0: (Runner) stopped.
Run Code Online (Sandbox Code Playgroud)
我已经尝试了一切,从从应用程序中删除消息到检查 Xcode 中是否启用了“推送通知”和“后台获取”,但应用程序仍然不断崩溃。错误日志显示崩溃是由于firebase.auth.globalWorkQueue应用程序在模拟器上启动得很好。我删除了 firebase_messaging,但应用程序在模拟器上运行时仍然崩溃。任何建议将不胜感激。
因此,经过大约一周的不眠之夜、重新整理依赖项、降级、升级包和版本,结果发现问题出在我的 flutter 代码上。随着零安全性的变化。将 null 值推送到本机 Firebase SDK 会导致崩溃而不是错误,并且我从共享首选项中获取未经检查的 null 值。我预计我的代码会出现错误,但崩溃了,所以它不断崩溃。如果您在代码中看到上述错误,则您\xe2\x80\x99 可能会将空值推入登录函数中。检查一下
\n| 归档时间: |
|
| 查看次数: |
2684 次 |
| 最近记录: |