How can I make the `PlaceAutocompleteFragment` resolved?

Gilian picture Gilian · Jan 6, 2016 · Viewed 18.6k times · Source

How can I make the PlaceAutocompleteFragment resolved?

Hi guys, I'm trying to use the new PlaceAutocompleteFragment. I try to use the following code:

<fragment
  android:id="@+id/place_autocomplete_fragment"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:name="com.google.android.gms.location.places.ui.PlaceAutocompleteFragment"
  />

This code sample is just a copy. It is from this site. However PlaceAutocompleteFragment is unresolved in my case. How can I fix this issue? I think the solution must be very easy. However I have been looking for quite some time.

Answer

Mahesh Giri picture Mahesh Giri · Jan 6, 2016

For uses of PlaceAutocompleteFragment we need to add one lib in gradle add this

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

in your gradle of Android Application.I have checked this in my Android studio. Please let me know if your problem is solved.

Check version (16.0.0 at the time of writing) of play-services here.
(From the comment below)