1

I am trying to convert one of my apps to instant apps and PlaceAutocomplete is an important part of the app. But I am unable to find any documentation or any way in how to use PlaceAutocomplete in Instant app.

I am using this code

try {
         Intent intent = new PlaceAutocomplete.IntentBuilder(PlaceAutocomplete.MODE_OVERLAY)
                            .build(getActivity());
         startActivityForResult(intent, PLACE_AUTOCOMPLETE_REQUEST_CODE);
    } catch (GooglePlayServicesRepairableException e) {
         Log.e("Place Autocomplete",e.getLocalizedMessage());
    } catch (GooglePlayServicesNotAvailableException e) {
         Log.e("Place Autocomplete",e.getLocalizedMessage());
    }

and it's working fine in Installed version but when the same code is executed in instant app version this error is thrown and app crashes.

No Activity found to handle Intent { act=com.google.android.gms.location.places.ui.AUTOCOMPLETE pkg=com.google.android.gms (has extras) }

Issue report.

I am using

api 'com.google.android.gms:play-services-places:16.0.0'
api 'com.google.android.gms:play-services-location:16.0.0'

in my baseFeature and

implementation 'com.google.android.gms:play-services-places:16.0.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'

in my feature module.

I have also added google-services.json and added `apply plugin: 'com.google.gms.google-services' in my app module.

So, what am I doing wrong and if PlaceAutocomplete does not support Instant what are the alternates I can use. `

DarkMinion
  • 11
  • 3
  • Have you tried to run your instant app on pre-O device? For me PlaceAutocomplete works fine on pre-O, but crashes on O+. If you can see the same behavior, can you file a bug at https://issuetracker.google.com/issues/new?component=316045&template=1018787 and link to it back in here? – Julia K Oct 26 '18 at 18:08
  • Sorry for the delay. I have already opened an issue on issue tracker https://issuetracker.google.com/118398809 . I was not able to test it on pre oreo devices but worked around by using current user location till this problem gets resolved. – DarkMinion Oct 30 '18 at 04:58
  • It doesn't look like this API is available for Instant Apps yet, also see https://stackoverflow.com/questions/47580594/google-places-autocomplete-api-gives-api-not-connected-error-in-instant-apps-con I just tried all the PlacesComplete samples @ https://github.com/googlesamples/android-play-places and none of them worked for O+ – TWL Nov 02 '18 at 22:13
  • https://issuetracker.google.com/issues/80149649 and based on this issue link they are not going to fix it in future I guess. – DarkMinion Nov 03 '18 at 11:08

1 Answers1

0

I had this issue. It s not working for android 8.0 or upper.

In this case, I m not using the place autocomplete from the library but I implemented the my own auto completion textview with the google maps api (https).

I keep using the other feature of the google map android lib. Only this part was bringing a blocker to deploy.

Fred
  • 24
  • 3