rtchagas / pingplacepicker

An almost plug and play replacement for Google's Place Picker
Apache License 2.0
142 stars 55 forks source link

Couldn't find the selected place #66

Closed tangent-q closed 4 years ago

tangent-q commented 4 years ago

Issue 1: I could not get the map using only 3 APIs as mentioned here: https://raw.githubusercontent.com/rtchagas/pingplacepicker/master/images/maps_api_key.png

Was getting the following error: 2020-03-10 20:01:59.766 30912-31192/ E/Google Maps Android API: Authorization failure. Please see https://developers.google.com/maps/documentation/android-api/start for how to correctly set up the map. 2020-03-10 20:01:59.769 30912-31192/ E/Google Maps Android API: In the Google Developer Console (https://console.developers.google.com) Ensure that the "Google Maps Android API v2" is enabled. Ensure that the following Android Key exists

It's solved now: After adding additional API "Maps SDK for Android" to the key, I could finally get the map.

Issue 2 Now, I get the map but the Search and the bottom section including "Select this location" is still not working. It says "Couldn't find the selected place". I don't have any suspicious logs as well to show you.

What could be the issue ?

rtchagas commented 4 years ago

Hi @tangentq-admin

Regarding your issue number 1, you don't need to set "Maps SDK for Android" in your Maps Key. That SDK is accessed via the Android Key.

So make sure your Android Key is configured and you have set the correct SHA1 for your app.

This is also related to your issue number 2. If you're not using the /nearbysearch mode, PING will fetch the places from Android Places SDK and this one also needs the Android Key.

tangent-q commented 4 years ago

Hi @rtchagas It was a config issue from my side related to the billing. I was using 2 different GCloud projects due to some strange restrictions.

However, the lib wasn't logging/showing me any such error/warning which was thrown by google libs. I had to debug inside the pingplacepicker to troubleshoot and get the actual error thrown.

So I would suggest to log the error thrown by google lib in any kind of errors. Will be easy to troubleshoot and saves lot of time.

Can create a PR if you agree.

SteveKamau72 commented 4 years ago

@tangentq-admin could you direct me to the specific file number to log this out as well? I am stuck with the same issue.

tangent-q commented 4 years ago

@SteveKamau72 , https://github.com/rtchagas/pingplacepicker/blob/master/library/src/main/java/com/rtchagas/pingplacepicker/ui/PlacePickerActivity.kt#L418

I had put a breakpoint at this error handler Resource.Status.ERROR and I could see the real error.