首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >应用程序在IOS中崩溃-客户端已经被终止。

应用程序在IOS中崩溃-客户端已经被终止。
EN

Stack Overflow用户
提问于 2022-02-01 05:12:04
回答 1查看 407关注 0票数 2

我已经开发了颤振应用,因为我实现了隔离功能。在实现隔离功能之后,应用程序正在崩溃,而应用程序正在启动。

在隔离函数中,我正在初始化Firebase。

代码语言:javascript
运行
复制
await Firebase.initializeApp();

当进程在隔离函数中完成时,我将终止防火墙。

代码语言:javascript
运行
复制
await FirebaseFirestore.instance.terminate();
await FirebaseFirestore.instance.clearPersistence();

在应用程序崩溃时,错误日志显示:

代码语言:javascript
运行
复制
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

请帮我解决这个问题,谢谢。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-02-11 17:40:47

颠倒顺序:

代码语言:javascript
运行
复制
await FirebaseFirestore.instance.clearPersistence();
await FirebaseFirestore.instance.terminate();

一旦终止实例,就不能尝试修改其缓存的数据。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70935832

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档