由于未知的异常而终止应用程序。

发布于 2025-02-09 15:25:01 字数 1704 浏览 1 评论 0 原文

我们使用以下doc 。根据文档,我们在[FIRAPP配置]之前添加了远程配置值;。但这会引起崩溃问题

2022-06-22 21:27:01.049448+0530 Axis Mobile [925:112552] ***由于未知的例外'FirappNotConfigured'终止应用程序,原因:'在可以初始化默认远程配置实例之前进行配置。确保这是在应用程序代表的 application(_:didfinishlaunchingwithoptions:) @main struct> struct> struct> struct> struct> struct> struct> struct> struct> struct> struct> struct> struct> struct> struct> struct> struct> struct> struct> struct> struct> struct> swiftui中的初始化器。'

这是我们的实现代码

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
self.remoteConfig = [FIRRemoteConfig remoteConfig];
FIRRemoteConfigSettings *remoteConfigSettings = [[FIRRemoteConfigSettings alloc] init];
remoteConfigSettings.minimumFetchInterval = 0;
self.remoteConfig.configSettings = remoteConfigSettings;
[self.remoteConfig setDefaultsFromPlistFileName:@"RemoteConfigDefaults"];
[FIRPerformance sharedInstance].instrumentationEnabled = ![self.remoteConfig configValueForKey:@"perf_disable"].boolValue;
[FIRPerformance sharedInstance].dataCollectionEnabled = ![self.remoteConfig configValueForKey:@"perf_disable"].boolValue;
[FIRApp configure];
return YES;

}

如果我们添加[FIRAPP配置],因为初始应用程序尚未崩溃。但是[Firperformance sharedInstance] InsTrumentationEnabled阻止了一些API响应。请帮助我解决这个问题。提前致谢。

We have integrated FirebasePerformance and RemoteConfig SDK in our application using the following doc https://firebase.google.com/docs/perf-mon/disable-sdk?platform=ios. As per the document, we added the remote config value before [FIRApp configure];. But it creates a crash issue

2022-06-22 21:27:01.049448+0530 Axis Mobile[925:112552] *** Terminating app due to uncaught exception 'FIRAppNotConfigured', reason: 'The default FirebaseApp instance must be configured before the default Remote Config instance can be initialized. One way to ensure this is to call FirebaseApp.configure() in the App Delegate's application(_:didFinishLaunchingWithOptions:) or the @main struct's initializer in SwiftUI.'

enter image description here

This is our implementation code

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
self.remoteConfig = [FIRRemoteConfig remoteConfig];
FIRRemoteConfigSettings *remoteConfigSettings = [[FIRRemoteConfigSettings alloc] init];
remoteConfigSettings.minimumFetchInterval = 0;
self.remoteConfig.configSettings = remoteConfigSettings;
[self.remoteConfig setDefaultsFromPlistFileName:@"RemoteConfigDefaults"];
[FIRPerformance sharedInstance].instrumentationEnabled = ![self.remoteConfig configValueForKey:@"perf_disable"].boolValue;
[FIRPerformance sharedInstance].dataCollectionEnabled = ![self.remoteConfig configValueForKey:@"perf_disable"].boolValue;
[FIRApp configure];
return YES;

}

If we add [FIRApp configure] as the initial app has not crashed. But [FIRPerformance sharedInstance].instrumentationEnabled blocking some API response. Kindly help me resolve this. Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文