Google Maps iOS sdks gets error: background execution in this scenario will crash

I am trying to add a map to my custom keyboard extension. After I tried to add MKMapView to the keyboard, I immediately crash when the map view appeared. Therefore, I am trying to add a Google map to the keyboard. But no luck, I get an error message:

Terminating app due to uncaught exception 'GMSBackgroundAppException', reason: 'Background execution would crash in this scenario'

I copied the exact code from the documentation on Google maps, and I ran this code in another empty project, and it worked. But that just won't work in a custom keyboard extension. This gives me the error above. If you still want to see the code below:

 - (void)viewDidLoad { [super viewDidLoad]; GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:-33.86 longitude:151.20 zoom:6]; mapView_ = [GMSMapView mapWithFrame:CGRectZero camera:camera]; mapView_.myLocationEnabled = YES; self.view = mapView_; // Creates a marker in the center of the map. GMSMarker *marker = [[GMSMarker alloc] init]; marker.position = CLLocationCoordinate2DMake(-33.86, 151.20); marker.title = @"Sydney"; marker.snippet = @"Australia"; marker.map = mapView_; } 
+5
source share

Source: https://habr.com/ru/post/1206682/


All Articles