Firebase-ios-sdk: [NSProcessInfo isiOSAppOnMac] crash

Created on 14 Nov 2020  路  13Comments  路  Source: firebase/firebase-ios-sdk

[REQUIRED] Step 1: Describe your environment

  • Xcode version: 12.0
  • Firebase SDK version: master branch
  • Installation method: CocoaPods
  • Firebase Component: GoogleUtilities
  • iOS version: 14.0

[REQUIRED] Step 2: Describe the problem

* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSProcessInfo isiOSAppOnMac]: unrecognized selector sent to instance 0x2834ac5d0'
Screen Shot 2020-11-14 at 16 55 24

Steps to reproduce:

It was generated from users, I have not find reproduce steps. I thinks the pic above will help.

Relevant Code:

//GULAppEnvironmentUtil.m
+ (NSString *)applePlatform {
  NSString *applePlatform = @"unknown";

  ...
#if defined(__IPHONE_14_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 140000
  if (@available(iOS 14.0, *)) {
    applePlatform = [NSProcessInfo processInfo].isiOSAppOnMac ? @"ios_on_mac" : @"ios";
  } else {
    applePlatform = @"ios";
  }
...
}
GoogleUtilities beta-software

Most helpful comment

Could it be that the isiOSAppOnMac API wasn't available in the early iOS 14 betas?

I confirm your idea, I have a phone with first beta and the crash occure 100% on this device. But not on device without beta

All 13 comments

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

@shanksGuo Thanks for the report. Do you have device information for the crashes? And can you confirm that the crash occurs on iOS 14 and only iOS 14?

So far, according to our owner crash collection system, this crash only happened only on iOS14. We are trying to reproduce this locally.

Experiencing the same crash - 100% on iPhone (0 crashes on iPad for some reason) w/ iOS14 (we got plenty of them). Can't repro it locally though :-/

Could it be that the isiOSAppOnMac API wasn't available in the early iOS 14 betas?

@paulb777 that's my guess as well, I think I recall seeing something similar. I'm not sure if the @available check allows, but if so we could check for 14.0.1 and that could resolve it? Or we wrap in a respondsToSelector

so far, I've only dicovered limited users of this type of crash, and cannot reproduce locally.

Could it be that the isiOSAppOnMac API wasn't available in the early iOS 14 betas?

I confirm your idea, I have a phone with first beta and the crash occure 100% on this device. But not on device without beta

Seeing this on an iPad running an older beta. Updating it now.

Planning to release the fix in GoogleUtilities 7.1.1 to CocoaPods in the next few days. The other Firebase distributions will pick this up in 7.2.0

Run pod update to get Google Utilities 7.1.1 that just published to CocoaPods

Thanks, I will update this.

Run pod update to get Google Utilities 7.1.1 that just published to CocoaPods

thank you

Was this page helpful?
0 / 5 - 0 ratings