meteorSD
meteorSD

Reputation: 339

GoogleMaps SDK classes undeclared type or unresolved identifier

I am using cocoapods to import libraries.

I just updated my pods and since then some of the GoogleMaps SDK classes are not available anymore. For example GMSAutocompletePrediction or GMSPlacesClient labeled as "use of undeclared type" and "use of unresolved identifier". I have tried to remove the GoogleMaps pods and then to reinstall it but it didnt work. Even though, some classes are still usable, like GMSAddress for example.

I noticed that GoogleMaps was not one of the target in the Pods project of my workspace, could it be related to my problem ?

enter image description here

Upvotes: 4

Views: 2900

Answers (2)

meteorSD
meteorSD

Reputation: 339

I finally found the solution. In fact since the new update of GoogleMaps I also have to import GooglePlaces to use the classes "GMSAutocompleterPrediction", "GMSPlaces"...

I don't understand why I didnt have to do that before.

Edit : So to solve this problem you only have to add "GooglePlaces" to your project, and then import it everywhere you need to use these classes.

Upvotes: 8

Chirag Patel
Chirag Patel

Reputation: 1481

1.One of the classes has a Testing target and other one doesn't. You have to even include all of your classes in the testing target or none of them. 2.If it's Objective C class, check that the class is in ObjectiveC bridging header file. 3.If it's NSManagedObject subclass. Add @objc(className) before the class declaration. 4.If it's part of a different framework, make sure that the class or function is public

Also see this link: 'Use of Unresolved Identifier' in Swift

Upvotes: 0

Related Questions