7

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

Community
  • 1
  • 1
Fantini
  • 2,067
  • 21
  • 32
  • 1
    Experiencing the same here. Its annoying. It just suddenly wont work on 8.3 – Teffi Jul 15 '15 at 05:59
  • 1
    Found out that it only happens on development provisioning profile. But once you packed it for distribution , the bug does not occur. – Teffi Jul 15 '15 at 09:09
  • 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 get the exc_bad_access, it's a debugger error then?, I'm confused. – Fantini Jul 17 '15 at 14:10

3 Answers3

9

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!

Community
  • 1
  • 1
Fantini
  • 2,067
  • 21
  • 32
  • its worked like a charm..thnks..but Is there any other issues we can encounter by changing this configuration?it will not affect other code? – BhavikKama Oct 06 '15 at 10:22
  • I don't really know and answer to that question, in my experience the app works just fine, but I don't know if there's any performance issue or if will be any in the future. – Fantini Oct 06 '15 at 14:19
  • Hit the problem with iOS 11.0 and SceneKit on a few projects – Michael Yagudaev Jul 26 '17 at 19:39
1

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

0

i had the exact same problem:

iphone 4 -> iOs 7 (working)

xcode simulator (working)

iphone 5s -> iOs 8.3 (NOT working EXC_BAD_ACCESS)

SOLUTION: i updated my iphone to iOs 8.4 and the problem is gone, maps are loading.

hope it helps

Mario Jaramillo
  • 567
  • 6
  • 9
  • 1
    Thanks for the answer but that is not what I'm looking for, what if a user donwloads the app in a device with the same setup, he wont be able to run the app, I need to solve this error. – Fantini Jul 14 '15 at 11:19