uber / rides-ios-sdk

Uber Rides iOS SDK (beta)
https://developer.uber.com/docs
MIT License
371 stars 123 forks source link

Crash on launch of app on iPhone 5 devices #268

Open maleksiuk opened 4 years ago

maleksiuk commented 4 years ago

A user with an iPhone 5, iOS 10.3.4 is getting a crash on launch of the app. It's an EXC_BAD_ACCESS with the only useful thread info being method descriptor for RideReceipt.encode(to:).

It is crashing before our application(_:didFinishLaunchingWithOptions:) function does much of anything, and before we do anything with the Uber code (except for importing UberRides and UberCore at the top of the app delegate).

We weren't having this problem on the previous version of our app which was built on iOS Build SDK 17A820 (13.1), but are now that we're using iOS Build SDK 17E255 (13.4). Both use version 0.13 of UberRides.

I was able to reproduce this on an iPhone 5c, just in Release mode. To fix it, all I had to do was move the line @objc public private(set) var chargeAdjustments: [RideCharge]? from the top of RideReceipt to be just before the CodingKeys enum is defined.

I have no idea why that fix works. Maybe you'll be able to figure it out and find a more sane fix.