Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FirApp configure crash specific to iOS 8 #4957

Closed
gatesjef opened this issue Feb 23, 2020 · 10 comments
Closed

FirApp configure crash specific to iOS 8 #4957

gatesjef opened this issue Feb 23, 2020 · 10 comments

Comments

@gatesjef
Copy link

gatesjef commented Feb 23, 2020

Xcode version: 10.2.1
iOS Version : 8.4.1 (8.4 simulator)
This involves the Core/Messaging components. I'm uncertain the Firebase version, is there a way to tell from the header/module files? Our Android version that was updated at pretty much the same time (spring 2019) is firebase-messaging:17.4.0. (The android version has no problems).

Calling [FirApp configure] crashes on iOS 8.4 (simulator) with:

'NSInvalidArgumentException', reason:' *** setObjectForKey: object cannot be nil (key:safelisted_events)'

0   CoreFoundation                      0x0000000111fc7c65 __exceptionPreprocess + 165	
1   libobjc.A.dylib                     0x0000000113905bb7 objc_exception_throw + 45	
2   CoreFoundation                      0x0000000111eccaf8 -[__NSDictionaryM setObject:forKey:] + 968	
3   Rollios                             0x000000010f6f83bb +[FIRAnalytics startWithConfiguration:options:] + 421	
4   Rollios                             0x000000010f6fbbe9 -[FIRApp configureCore] + 507	
5   Rollios                             0x000000010f6fb833 +[FIRApp addAppToAppDictionary:] + 97	
6   Rollios                             0x000000010f6fb216 +[FIRApp configureWithName:options:] + 711	
7   Rollios                             0x000000010f6faf40 +[FIRApp configureWithOptions:] + 92	
8   Rollios                             0x000000010f6faeb7 +[FIRApp configure] + 460

Here is an elided version ouf our plist
GoogleServer-Info-elided.plist

A user reported what seems to be this crash as well on 8.4.1 physical, but we don't have access to the device to validate.

This works fine on other iOS versions we've tested, (physical 9.3.5, simulator 12.2, and roughly half a dozen user devices of unknown config).

@google-oss-bot

This comment has been minimized.

@maksymmalyhin
Copy link
Contributor

maksymmalyhin commented Feb 24, 2020

@gatesjef Could you please specify Firebase SDK versions (in particular FirebaseCore and FirebaseAnalytics) you are using.

@maksymmalyhin
Copy link
Contributor

Most likely the issue is related to a different behaviour of NSMutableDictionary setObject:forKeyedSubscript: method on iOS 8.

A possible workaround may be adding a key ANALYTICS_SAFELISTED_EVENTS with an empty array as a value to your GoogleService-Info.plist file. Could you please try it out and let us know if it is working for you?

@gatesjef
Copy link
Author

gatesjef commented Feb 24, 2020

Adding the ANALYTICS_SAFELISTED_EVENTS array key fixed the issue within the simulator. Thanks!
I'll follow up once we get a build to the user with the physical device.

Sorry, I don't know a great way to get the version number for the particular Firebase libraries on iOS that we are using. I can't seem to find any reference to the version within the code files themselves and unfortunately we don't have access to the repository history going back to the date. It was 'Whatever was latest spring-ish 2019 at the same time android was on firebase-messaging:17.4.0.' If you have any suggestions of how to get this info, please let me know.

@maksymmalyhin
Copy link
Contributor

@gatesjef If you use Cocoapods to manage your dependency you probably should have Podfile.lock checked in into your repository. The file contains all the versions of the dependencies. So far, I think, definition "latest spring-ish 2019" is precise enough for the issue.

@maksymmalyhin
Copy link
Contributor

@gatesjef I would recommend to double check that Analytics is working as expected after adding ANALYTICS_SAFELISTED_EVENTS key.

@gatesjef
Copy link
Author

We don't use cocopods, sorry. We just downloaded the frameworks and then added them manually to the workspace.

Thanks for the heads up about testing. We only really use the Messaging component (on purpose anyways, I believe the system is reporting some analytics stuff by default and we haven't gone through the steps to try and turn that off.) So we'll double check that functionality out as soon as we get that on the physical device.

@gatesjef
Copy link
Author

The user with the 8.4.1 device launched successfully with the change.
We're a few days out from testing messaging, will report back then.

@morganchen12
Copy link
Contributor

This is fixed in upstream Analytics and will be out in a future release, so after a while the workaround will no longer be necessary.

Google-internal change: cr/297222629

@morganchen12 morganchen12 added this to the 6.19.0 - M66 milestone Feb 26, 2020
@maksymmalyhin
Copy link
Contributor

The fix scheduled to be released in 6.19.0 - M66

@firebase firebase locked and limited conversation to collaborators Apr 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants