Use of undeclared type 'GMSPlacesClient'
Asked Answered
B

5

8

I'm trying to implement Google Auto complete service and, I get this message:

Use of undeclared type 'GMSPlacesClient'

I imported Google Maps module and it works with GMSMapView... I don't understand what is happening. Does anyone have the same error?
This is a picture of the error:

ErrorImage

ErrorImage

Thank you very much!

Busily answered 28/7, 2016 at 11:23 Comment(0)
B
7

I found the problem. Google has divided his API in two parts. Last release splits the Places API from the Maps SDK (since Version 2.0.0 - July 26, 2016). You can find it in the release notes: https://developers.google.com/places/ios-api/releases?hl=es

Busily answered 28/7, 2016 at 21:57 Comment(2)
But posting a link to the docs is not a direct solution to the original error we receive in XCode, Use of undeclared type 'GMSPlacesClient'...Hanker
Plus that is a 404 link...Hanker
P
18

I have also face the same issue. To resolve this I have add pod GooglePlaces in my pod file and update the pod.

Also you need to replace import import GoogleMaps To import GooglePlaces

Pallbearer answered 10/8, 2016 at 11:45 Comment(1)
I've done this and it didn't resolve the problemHanker
B
7

I found the problem. Google has divided his API in two parts. Last release splits the Places API from the Maps SDK (since Version 2.0.0 - July 26, 2016). You can find it in the release notes: https://developers.google.com/places/ios-api/releases?hl=es

Busily answered 28/7, 2016 at 21:57 Comment(2)
But posting a link to the docs is not a direct solution to the original error we receive in XCode, Use of undeclared type 'GMSPlacesClient'...Hanker
Plus that is a 404 link...Hanker
S
2

I bumped the same problem recently. It seems that the reason of issue is updated GoogleMap library. They changed their API. My solution was just return to the previous version of GoogleMaps. For me the working version is 1.13.2.

If you want to specify the v1.13.2 you can put it to the Podfile:

pod 'GoogleMaps', '~> 1.13.2'
Schnitzler answered 28/8, 2016 at 17:51 Comment(0)
D
1

Add this

import <GooglePlaces/GooglePlaces.h>

into

TSTHelmet-Bridging-Header.h

Despatch answered 23/11, 2016 at 17:41 Comment(0)
A
0

Open your terminal, cd to your project folder and run pod update, or better yet pod update --verbose.

Allier answered 19/4, 2019 at 7:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.