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