Switch Google Maps SDK & Mapkit in the same app cause crash

删除回忆录丶 提交于 2019-11-30 15:58:20

We were having the same issues after first integrating Google Maps into our iOS app. The solution that seems to work for us so far has been to wait some period of time after releasing the GMSMapView and all related Google Maps objects, prior to instantiating any MapKit objects.

Based on our testing to thus far, our thought is that the GMSMapView object hierarchy is released asynchronously, and doesn't seem to aggressively re-establish its EAGLContext as "current" prior to releasing OpenGL resources. So if MapKit switches the current EAGLContext, then the GMSMapView hierarchy proceeds with releasing resources, you get a cross pollination of OpenGL resource release.

So our steps are:

  1. Release GMSMapView, and all GMS related objects
  2. Wait 100ms (0.1 sec)
  3. Set the EAGLEContext to nil
  4. Allocate MKMapView and proceed.

So far this has worked for us. Good luck.

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