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

家住魔仙堡 提交于 2019-12-21 04:42:52

问题


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:

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


回答1:


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!




回答2:


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




回答3:


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



来源:https://stackoverflow.com/questions/31390630/exc-bad-access-using-gmaps-sdk-1-9-0-xcode-6-4-running-on-8-3-device

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!