Adding google maps as subview crashes iOS app with exc_bad Adding google maps as subview crashes iOS app with exc_bad ios ios

Adding google maps as subview crashes iOS app with exc_bad


EDIT: I've found the root of the problem and have a workaround:

The problem seems to be triggered by OpenGL ES Frame Capture in XCode; I'm guessing this problem started when Apple added Metal to the mix as of XCode 6.4/iOS 8.3, perhaps somehow adversely affecting the entire frame capture debugging system.

The workaround:

  1. In XCode, go to Product > Scheme > Edit Scheme...
  2. Select the "Run" Tab on the left.
  3. Select the "Options" sub-tab on the top.
  4. Change "GPU Frame Capture" from "Automatically Enabled" or "OpenGL ES" to either "Metal" or "Disabled".

This disables OpenGL ES frame capture, which isn't great, but allows you to continue debugging your builds.

Not sure if this issue is Apple's or Google's but I'll be posting bug reports to both. Happy coding!

--

earlier post:

Some further info (would make this a comment but don't have the rep quite yet) as I'm experiencing this too; as best I can tell:

  • The issue is apparent in XCode 6.4 as well as XCode 7 beta 3
  • It presents itself in debug mode only, not running outside XCode.
  • It doesn't manifest on iOS 8.1.2 but it does on iOS 8.3.
  • It happens with both Google Maps 1.9.X (imported as a Framework file) as well as 1.10.X (imported as a CocoaPod, including the latest)
  • I can't verify this completely yet but it hasn't shown up in XCode 6.3.2 for me; this might be because I can't compile for 8.3 in that version.

I'll likely miss the deadline for the swag bounty but I'm spending all day tomorrow digging deeper and will report back.


This happened to mee too when I was using the Google Maps SDK. I filed a bug report as after restarting Xcode and deleting the project and reinstalling it, it worked perfectly fine.

This is not your problem, but simply a bug. If you install the build through test flight or the App Store it will work like a charm.

For debugging, just keep restarting Xcode and if possible try to run it through Xcode 7. There's a chance they fixed this bug.

Hope that helps, Julian


Yoav Schwartz, have you tried assigning the mapView.delegate only after insertSubview of the mapView into your view hierarchy?

I am experiencing something similar and I suspect it to be a bug with Xcode 6.4 as Julian alludes to above.

James Pereira/@marinehero