Today, I updated to google play services to 9.2.0.
I got an error
com.google.android.gms.location.places.Places
not found. that broke below two lines
.addApi(Places.GEO_DATA_API)
.addApi(Places.PLACE_DETECTION_API)
any leads on where i can find GEO_DATA_API, PLACE_DETECTION_API
Thanks in advance.
In 9.0.2, the 'places' library was inside 'location' library. In 9.2, you need to add 'places' library as dependency:
implementation 'com.google.android.gms:play-services-places:9.2.0'
The document is not updated as of 28th June. I suggest downgrading play services library to 9.0.2. (docs last updated on 23th June).
Edited:
as Emerson suggested,
compile 'com.google.android.gms:play-services-places:9.2.0'
add that for places library to your Gradle. It's not updated in official documentation.
for play service 9.2.0 places import has changed from
import com.google.android.gms.location.places;
to
import com.google.android.gms.location.places.Place;
or you need all places folder
import com.google.android.gms.location.places.*;
Related
I want to use Google places API but I can't sync the project with "com.google.android.libraries.places:1.0.0:" dependency. How to add the places in my project?.
The library in documentation is wrong I guess, use this, it works.
I had same issue few days back , gave a feedback to them on documentation they still didn't fix it.
implementation 'com.google.android.libraries.places:places:2.1.0'
You can see how to add places autocomplete over here
Edit: Seems like they finally fixed the documentation
try to change
compileOnly "com.facebook.react:react-native:+"
by
api "com.facebook.react:react-native:+"
I also stuck with the same issue, now i removed this issue. According to google,
"The v1.0.0 release of the Places SDK for Android introduces an all-new static library with updated functionality. The Google Play Services version of the Places SDK for Android (in Google Play Services 16.0.0) is deprecated as of January 29, 2019, and will be turned off on July 29, 2019."
Add following dependency it will work...
implementation 'com.google.android.libraries.places:places:1.0.0'
For more information you can visit,
https://developers.google.com/places/android-sdk/client-migration
I am trying to implement Google Places on my Android App. I already have Google Maps working and I have enabled the Places SDK for Android API to the project but it still does not recognize any of the Places's classes.
import com.google.android.gms.location.places.AutocompleteFilter;
import com.google.android.gms.location.places.AutocompletePrediction;
import com.google.android.gms.location.places.AutocompletePredictionBufferResponse;
import com.google.android.gms.location.places.GeoDataClient;
The project does not recognize these imports.
The Place Picker is deprecated as of January 29, 2019. This feature will be turned off on July 29, 2019, and will no longer be available after that date. To continue using the Place Picker through the deprecation period, do NOT disable the Places SDK for Android in your Google Cloud Platform project, as doing so will also disable the Place Picker.
https://developers.google.com/places/android-sdk/client-migration#compat
Maps != Places != Routes
You probably don't have the dependency yet on the build file. However, due to Google's recent Maps monetization policy, you will have to setup a billing account. Go here: https://cloud.google.com/maps-platform and complete the mini wizard. It will do additional setup on your projects and will probably (I didn't go through it yet) give you the exact implementation sentence you need to declare.
The GeoDataClient and AutocompletePredictionBufferResponse classes were added in Google Play Services 11.2.0.
So, make sure that you're using at least version 11.2.0 of Google Play Services:
dependencies {
compile 'com.google.android.gms:play-services-maps:11.2.0'
compile 'com.google.android.gms:play-services-location:11.2.0'
compile 'com.google.android.gms:play-services-places:11.2.0'
//.....
}
I having a errorCannot resolve symbol 'FusedLocationProviderClient' while declaring
private FusedLocationProviderClient mFusedLocationClient;
The same is asked here Cannot Resolve Symbol: FusedLocationProviderClient. Google play services version used 11.0.1 . But still am having the error while using the latest play services.
FusedLocationProvider is part of play-services-location. You are using play-services-maps. Add dependency :
compile 'com.google.android.gms:play-services-location:11.6.0'
Edit
Seems like this was helpful for quite a few people. Here is a link to google docs where all individual library names in play-services along with latest version numbers are kept : https://developers.google.com/android/guides/setup I hope google keeps it updated.
Note: It's recommended to use Google Play services version 11.6.0 or higher, which includes bug fixes for this class. More details here.
https://developers.google.com/android/reference/com/google/android/gms/location/FusedLocationProviderClient
After I Updated gms:play-services-location from 9.0.2 to 9.6.1, I couldn't import com.google.android.gms.location.places.Place and I couldn't use PlaceAutoComplete either.
Was it deprecated or removed from google play service location?
Per the list of split dependencies, to include the places APIs, you must include the dependency
compile 'com.google.android.gms:play-services-places:9.6.1'
The places dependency was only added in Google Play services 9.2.0 - before that, it was part of the maps dependency, which was a requirement for location (version 9.6.0 also removed the dependency of location on maps), hence why previously when you included location you also got places.
add this version in your gradle
compile 'com.google.android.gms:play-services:7.3.0'
I am creating android application 'GoogleCloudMessaging'. I Have found many that 'GcmListenerService' is being used and the old method 'GCMIntentService' is now deprecated.
I have already install the Google Play service and add it into the dependency.
But when i try to import
import com.google.android.gms.gcm.GcmListenerService;
it gives error "cannot resolve symbol."
How can I import the Class?
I refer https://developers.google.com/android/reference/com/google/android/gms/gcm/GoogleCloudMessaging and
https://developers.google.com/android/reference/com/google/android/gms/gcm/GcmListenerService.html#GcmListenerService()
and follow the things but still unable to solve the problem.
If you have already added Google Play Services to your dependencies, the issue might be its version.
Try to update the line(in your build.gradle) to:
compile 'com.google.android.gms:play-services:7.5.0'
Then sync your project.
You must include
compile 'com.google.android.gms:play-services-gcm:11.0.4'
in your build.gradle file.