我已经开发了颤振应用,因为我实现了隔离功能。在实现隔离功能之后,应用程序正在崩溃,而应用程序正在启动。
在隔离函数中,我正在初始化Firebase。
await Firebase.initializeApp();
当进程在隔离函数中完成时,我将终止防火墙。
await FirebaseFirestore.instance.terminate();
await FirebaseFirestore.instance.clearPersistence();
在应用程序崩溃时,错误日志显示:
Incident Identifier: D3E1DB0C-893F-43CA-909A-49C5DA68F8DF
CrashReporter Key: 28B3B2E4-C62D-80C4-F0D1-42AAE9E88E5E
Hardware Model: iMac18,1
Process: Runner [16596]
Path: /Users/USER/Library/Developer/CoreSimulator/Devices/558D2DD4-FC71-4C6F-9007-9D369BEAADB8/data/Containers/Bundle/Application/B212F0D3-7088-46E2-A104-AC24B8079688/Runner.app/Runner
Identifier: -----
Version: -----
Code Type: X86-64 (Native)
Role: Foreground
Parent Process: launchd_sim [852]
Coalition: com.apple.CoreSimulator.SimDevice.558D2DD4-FC71-4C6F-9007-9D369BEAADB8 [800]
Responsible Process: SimulatorTrampoline [844]
Date/Time: 2022-01-13 19:45:40.6432 +0530
Launch Time: 2022-01-13 19:43:15.5481 +0530
OS Version: macOS 12.0.1 (21A559)
Release Type: User
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0
Application Specific Information:
dyld4 config: DYLD_ROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot
CoreSimulator 776.4 - Device: iPhone 8 Plus (********-****-****-****-************) - Runtime: iOS 15.0 (19A339) - DeviceType: iPhone 8 Plus
terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception 'FIRIllegalStateException', reason: 'The client has already been terminated.'
dyld4 config: DYLD_ROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot
abort() called
请帮我解决这个问题,谢谢。
发布于 2022-02-11 17:40:47
颠倒顺序:
await FirebaseFirestore.instance.clearPersistence();
await FirebaseFirestore.instance.terminate();
一旦终止实例,就不能尝试修改其缓存的数据。
https://stackoverflow.com/questions/70935832
复制相似问题