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?.

- 22,116
- 9
- 108
- 144
-
Post your `build.gradle` – Saurabh Thorat Feb 26 '19 at 05:30
-
3Please post your build.gradle. and don't use 'android-studio' tag unless your problem related to Android Studio. – WindSekirun Feb 26 '19 at 05:31
-
you should find a good tutorial on internet – Tejas Pandya Feb 26 '19 at 05:41
-
1can you suggest a tutorial for me. I try many tutorails, but i didnt clear my doubts. still i dont know how to add nearby places in the google Map. – Mar 04 '19 at 04:32
3 Answers
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

- 1,107
- 1
- 12
- 22

- 22,116
- 9
- 108
- 144
-
I'm trying with the same but i'm still getting could not resolve error :( do i need to change anything else? – madroid Feb 26 '19 at 07:41
-
Try adding `maven { url "https://maven.google.com" }` in project level `build.gradle` below jcentre() – Manohar Feb 26 '19 at 12:38
-
added it already but it is still giving the same error, it says sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target – madroid Feb 27 '19 at 09:34
-
-
1
-
Its easier to use their default intent launcher/ fragment instead of populating on recyclerview , Try implementing first using [documentation](https://developers.google.com/places/android-sdk/autocomplete) If you are having any problem then I will help – Manohar Feb 27 '19 at 13:04
-
com.google.android.libraries.places.widget.AutocompleteActivity}: java.lang.IllegalStateException: Places must be initialized. – Feb 28 '19 at 05:52
-
Actually i need for list near atm or hotels with user specified coverage. can you help me with that ? – Feb 28 '19 at 05:54
-
add this line `Places.initialize(getApplicationContext(), "GOOGLE_API_KEY")` – Manohar Feb 28 '19 at 06:45
-
-
try to change
compileOnly "com.facebook.react:react-native:+"
by
api "com.facebook.react:react-native:+"

- 31
- 2
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

- 21
- 6