简体   繁体   中英

nativescript ios app crash with EXC_BAD_ACCESS

I have an nativescript ios app that was working fine some days ago... then I upgrade the xcode version to 10.1 and the app stopped working...

Now I get EXC_BAD_ACCESS in the FIRApp file in the following line (322)

 if ([firAnalyticsClass respondsToSelector:startWithConfigurationSelector]) 

xcode屏幕截图

I have firebase in my app and it was working fine before. In my App_resoures/iOS folder I have the GoogleService-Info.plist that I downloaded from firebase site.

In my ngOnInit function in app.components.ts I have the following code:

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}`);
            }
          );

In the android app it's working like a charm.

If I run the app from Visual Studio Code, I can see the splash screen and then the app is closed without any error in the terminal/console. From xCode I get the error that I mentioned and in the console I get the following:

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
}

Deployment target

在此处输入图片说明

Because there's no answer I'll write what I did to resolve the issue that was derived from the above:

  • Running on an emulator wouldn't provide any meaningful error output, so instead I had to use a physical device
  • The physical device error log said that there was a mismatch of versions between FirebaseAnalytics and GoogleAppMeasurement. It appears that these pods have to match version exactly, but the dependency in podfile.lock is using '~>' instead of '='
  • Updating the podfile to include the exact version of GoogleAppMeasurement solved my build and deployment issues.

This may not work for you, but it worked for me, as the versions continue to deviate cocoapods will likely continue to produce mismatched versions.

A GitHub issue post that helped identify the specific issue I had is linked here.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM