要记住的事情:
>通过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:
解决方法
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:
- In XCode,go to Product > Scheme > Edit Scheme…
- Select the “Run” Tab on the left.
- Select the “Options” sub-tab on the top.
- 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!