0

xcode 7.2 version I have installed googlemaps through pods.Still getting this error.

Terminating app due to uncaught exception 'GMSServicesException', reason: 'Google Maps SDK for iOS must be initialized via [GMSServices provideAPIKey:...] prior to use'

Iam using locationManager as a global variable.

But when I use

var locationManager = CLLocationManager()
    var vwMap = GMSMapView()

within function it shows no error.

DanielBarbarian
  • 5,093
  • 12
  • 35
  • 44
thipoo24
  • 138
  • 15
  • Have you [followed all the steps outlined here](https://stackoverflow.com/questions/32205872/exceptiongoogle-maps-sdk-for-ios-must-be-initialized-via-gmsservices-provideap)? – Ken Y-N Nov 02 '16 at 07:26
  • yes.. But I have a doubt.. Do I need to update my xcode. No error when I declare locationManager within viewdidload method. – thipoo24 Nov 02 '16 at 07:28
  • You may also try the workaround given in this [thread](http://stackoverflow.com/a/32834129/5832311). Maybe you have initialize a field using Google Maps library in the one model class hence it will be created before the app runs. You may also check on this [related issue](https://code.google.com/p/gmaps-api-issues/issues/detail?id=8529). It stated that the `var mapView: GMSMapView` was too far up in `viewDidLoad` code. So try moving the `var mapView: GMSMapView` down a bit further to see if that fixes. – abielita Nov 06 '16 at 14:29

0 Answers0