相关疑难解决方法(0)

添加谷歌地图作为子视图使用exc_bad崩溃iOS应用程序

我的代码完全正常,直到大约3天前.我已经尝试回到一个更老的提交,它工作了100%,现在它仍然与exc_bad崩溃.崩溃只发生在设备上运行应用程序时,如果我在模拟器上运行应用程序或使用仪器在设备上运行应用程序,它运行完全正常.当我更改我的谷歌API密钥时,它说"您可能没有权限使用此API密钥",但不再崩溃.

该应用程序仅在通过xcode在设备上运行应用程序时崩溃.如果稍后在设备上运行相同版本而未连接到xcode,则可以正常工作.

我不知道我可以在这里添加哪些信息来帮助调试问题.我最近将xcode更新为6.4并使用最新更新更新了OSX.

我正在使用谷歌1.10.1 sdk版本,使用CocoaPods安装

我用来添加地图的代码:

self.mapView = [GMSMapView mapWithFrame:self.view.bounds camera:camera];

self.mapView.myLocationEnabled = YES;
self.mapView.settings.myLocationButton = YES;
self.mapView.delegate = self;

[self.mapView addObserver:self
               forKeyPath:@"myLocation"
                  options:NSKeyValueObservingOptionNew
                  context:NULL];

[self.view insertSubview:self.mapView atIndex:1];
Run Code Online (Sandbox Code Playgroud)

错误本身在code = 1,code = 2和code = 257之间变化.我尝试使用故事板而不是代码添加GMSMapView.我已经尝试安装旧版本的xcode并再次运行但它没有改变任何东西.

如果我注释掉插入子视图行,该应用程序不会崩溃.我试过运行僵尸乐器工具,但当我使用乐器运行时,应用程序工作正常.

#0  0x0000000100c5dc34 in EAGLContext_renderbufferStorageFromDrawable(EAGLContext*, objc_selector*, unsigned long, id<EAGLDrawable>) ()
#1  0x00000001002404c0 in gmscore::renderer::ios::GLRenderTarget::CreateFramebuffer() ()
#2  0x00000001002403cc in gmscore::renderer::ios::GLRenderTarget::FrameStart() ()
#3  0x00000001002e7af4 in gmscore::renderer::EntityRenderer::Draw(bool) ()
#4  0x00000001002516f4 in -[GMSPhoenixRenderer drawIfNeeded] ()
#5  0x00000001002329a0 in -[GMSEntityRendererView draw] ()
#6  0x000000010028dc74 in -[GMSDisplayLink displayLinkFired:] ()
#7  0x0000000100c5ca9c …
Run Code Online (Sandbox Code Playgroud)

xcode google-maps objective-c ios

39
推荐指数
1
解决办法
6244
查看次数

标签 统计

google-maps ×1

ios ×1

objective-c ×1

xcode ×1