ios – EXC_BAD_ACCESS使用gmaps sdk 1.9.0,Xcode 6.4,在8.3设备上运行

我有2个项目使用谷歌地图sdk,他们目前在Appstore.

要记住的事情:

>通过cocoapods安装Gmaps sdk 1.9.0版
> Xcode版本6.4
>部署目标7.1
>设备:带有8.3.0的iPhone 4s

今天我像往常一样在第一个项目中打开Xcode,尝试在iPhone上编译和调试,我有时会在应用程序上遇到EXC_BAD_ACCESS(代码= 1 …)崩溃,有时会得到EXC_BAD_ACCESS(代码= EXC_ARM_DA_ALING … ),这里没有堆栈跟踪,但总是在main.m上:

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

看到第一个线程我发现这是错误与谷歌地图有关:

尝试以下方法

>更新pod(不起作用)
>用gmaps sdk页面上的示例代码替换了我的代码(不起作用)*
> I have read关于自动布局的事情,禁用(不起作用)

奇怪的是我也是:

>在iPhone 6中尝试使用8.4(DID工作)
>尝试使用8.3的iPhone 6(DID工作)

这两个项目都处于早期测试状态,所以我不知道是否有任何真正的用户有这个问题,但我担心有些用户因此而无法使用这些应用程序.

我在互联网上找不到太多的信息,我甚至不知道在哪里看,是否有任何关于此问题的已知错误?,其他任何人都有同样的问题?

这是我正在使用的示例代码

-(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;
}

编辑1:

做更多的测试,发现只有在调试时才会出现问题(在运行应用程序时连接调试器),如果你从iPhone运行应用程序,然后将调试器连接到进程,一切运行正常,我的意思是,如果当附加调试器时,地图会尝试渲染然后你会得到exc_bad_access,然后是调试器错误吗?我很困惑

编辑2:

这在in here回答,谢谢Dave

解决方法

对此的回答不是我的,这回答了 in here,感谢 Dave,我只是引用他,所以任何人都可以看到答案.

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!

相关文章

当我们远离最新的 iOS 16 更新版本时,我们听到了困扰 Apple...
欧版/美版 特别说一下,美版选错了 可能会永久丧失4G,不过只...
一般在接外包的时候, 通常第三方需要安装你的app进行测...
前言为了让更多的人永远记住12月13日,各大厂都在这一天将应...