GoogleMaps SDK classes undeclared type or unresolved identifier

萝らか妹 提交于 2019-12-10 08:06:04

问题


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 ?


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/38793238/googlemaps-sdk-classes-undeclared-type-or-unresolved-identifier

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