【问题标题】:nativescript ios app crash with EXC_BAD_ACCESSnativescript ios 应用程序崩溃与 EXC_BAD_ACCESS
【发布时间】:2019-01-08 22:29:40
【问题描述】:

我有一个 nativescript ios 应用程序在几天前运行良好...然后我将 xcode 版本升级到 10.1 并且应用程序停止运行...

现在我在 FIRApp 文件中的以下行 (322) 中获得 EXC_BAD_ACCESS

 if ([firAnalyticsClass respondsToSelector:startWithConfigurationSelector]) 

我的应用中有 Firebase,之前它运行良好。 在我的 App_resoures/iOS 文件夹中,我有从 firebase 网站下载的 GoogleService-Info.plist

在 app.components.ts 的 ngOnInit 函数中,我有以下代码:

firebase.init({
            // Optionally pass in properties for database, authentication and cloud messaging,
            // see their respective docs.
            iOSEmulatorFlush: true // I found this as a solution but it's not working...
          }).then(
            () => {
              console.log("firebase.init done");
            },
            (error) => {
              console.log(`firebase.init error: ${error}`);
            }
          );

在 android 应用程序中,它就像一个魅力。

如果我从 Visual Studio Code 运行应用程序,我可以看到初始屏幕,然后应用程序在终端/控制台中关闭且没有任何错误。从 xCode 我得到我提到的错误,在控制台中我得到以下信息:

2019-01-08 19:22:26.600969-0300 gdp[53568:11407743]  - <AppMeasurement>[I-ACS036002] Analytics screen reporting is enabled. Call +[FIRAnalytics setScreenName:setScreenClass:] to set the screen name or override the default screen class name. To disable screen reporting, set the flag FirebaseScreenReportingEnabled to NO (boolean) in the Info.plist
2019-01-08 19:22:27.141461-0300 gdp[53568:11406950] libMobileGestalt MobileGestalt.c:890: MGIsDeviceOneOfType is not supported on this platform.
(lldb) 

firebase.nativescript.json

{
    "external_push_client_only": false,
    "using_ios": true,
    "using_android": true,
    "firestore": false,
    "realtimedb": false,
    "authentication": false,
    "remote_config": true,
    "performance_monitoring": true,
    "messaging": false,
    "crashlytics": true,
    "crash_reporting": false,
    "storage": false,
    "functions": false,
    "facebook_auth": false,
    "google_auth": false,
    "admob": false,
    "invites": false,
    "dynamic_links": false,
    "ml_kit": false
}

部署目标

【问题讨论】:

  • 在 Xcode 设置中寻找部署目标
  • 您是否在firebase.nativescript.json 文件中启用了分析功能?
  • @NarendraMongiya 我添加了来自 xCode 的屏幕截图。我尝试在图像中,也选择了 12.1,但结果是一样的
  • @Manoj 我添加了 firebase.nativescript.json 文件,该配置有什么问题吗?
  • 你解决了吗?

标签: ios firebase nativescript angular2-nativescript


【解决方案1】:

因为没有答案,所以我将写下我为解决上述问题所做的工作:

  • 在模拟器上运行不会提供任何有意义的错误输出,因此我不得不使用物理设备
  • 物理设备错误日志显示 FirebaseAnalytics 和 GoogleAppMeasurement 之间的版本不匹配。看来这些 pod 必须完全匹配版本,但 podfile.lock 中的依赖项使用的是 '~>' 而不是 '='
  • 更新 podfile 以包含 GoogleAppMeasurement 的确切版本解决了我的构建和部署问题。

这可能对你不起作用,但对我有用,因为版本继续偏离 cocoapods 可能会继续产生不匹配的版本。

此处链接了帮助确定我遇到的特定问题的 GitHub 问题帖子。

https://github.com/invertase/react-native-firebase/issues/1633

【讨论】:

    猜你喜欢
    • 2013-07-16
    • 2013-10-25
    • 2021-04-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多