Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EXC_BAD_ACCESS Using gmaps sdk 1.9.0, Xcode 6.4, running on 8.3 device

I have 2 projects working with google maps sdk, they are currently in the Appstore.

Things to have in mind:

  • Gmaps sdk version 1.9.0 installed via cocoapods
  • Xcode version 6.4
  • Deployment target 7.1
  • Device: iPhone 4s with 8.3.0

Today I've opened Xcode as usual with the first project, tried to compile and debug on the iPhone and I sometimes get a EXC_BAD_ACCESS (code=1...) crash on the app and sometime get EXC_BAD_ACCESS (code=EXC_ARM_DA_ALING...), no stack trace in here, but always on main.m:

return UIApplicationMain(argc, argv, nil, NSStringFromClass([TGPAppDelegate class]));

Seeing the first thread I've discovered that this is error is related to google maps:

Thread 1

Tried the following:

  • Updating the pod (didn't work)
  • Replaced my code with the sample code on gmaps sdk page (didn't work)*
  • I have read something about auto layout, disabled (didn't work)

The weird part is that I also:

  • Tried in an iPhone 6 with 8.4 (DID work)
  • Tried in an iPhone 6 with 8.3 (DID work)

Both project are in an early beta state, so I don't if the are any real user have this problem but I'm worried that some users wont be able to use the apps because of this.

I couldn't find too much information over the internet and I don't even know where to look, is there any reported known error regarding this?, anyone else with the same issue?

Here is the sample code I'm using:

-(void)viewDidLoad {
  [super viewDidLoad];

  GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:37.80948
                                                          longitude:5.965699
                                                               zoom:2];

  GMSMapView *mapView = [GMSMapView mapWithFrame:CGRectZero camera:camera];

  self.view = mapView;
}

EDIT 1:

Doing more tests, found out that the problem appears only when debugging (attaching the debugger when running the app), if you run the app from the iPhone and after that you attach the debugger to the process, everything runs ok, I mean, if the map tries to render when the debugger is attached then you will get the exc_bad_access, it's a debugger error then?, I'm confused

EDIT 2:

This in answered in here , thanks Dave

like image 854
Fantini Avatar asked Jul 13 '15 18:07

Fantini


2 Answers

The answer to this is not mine, this in answered in here , thanks Dave, I' m just quoting him so anyone can see the answer.

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: 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!

like image 138
Fantini Avatar answered Oct 20 '22 10:10

Fantini


Same problem here with MKMapView. Solution is rollback to (run side-by-side) Xcode 6.3.2. http://adcdownload.apple.com/Developer_Tools/Xcode_6.3.2/Xcode_6.3.2.dmg Also switch Command Line Tools to 6.3.2 in Preference -> Locations

like image 1
user5117927 Avatar answered Oct 20 '22 09:10

user5117927