Android studio can not resolve com.google.android.gms.location.places.AutocompleteFilter

北城以北 提交于 2019-11-29 01:13:08
ianhanniballake

The Places API was only added in Google Play services 7.0: you'll need to update your dependency to be at least 7.0.0, although the latest as of this answer is 15.0.0.

Note in almost every case, you should use selective APIs to only include the portions of Google Play services you need. In that case, you'd actually use a dependency such as

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

Add compile 'com.google.android.gms:play-services-places:<version>, where <version> is perhaps at least: 9.2.1 under dependencies in your modules's build.gradle

vishwa

In play-services 9.2.0 the places API is no longer located in location. Those are now in their own places dependency. To resolve those you should add this to your build.gradle.

compile 'com.google.android.gms:play-services-places:9.2.0'

check out

Places class is removed from android play services 9.2.0

Since Play Services version 9.2 we should add the following dependancy to access Google Places API.

 compile 'com.google.android.gms:play-services-places:11.0.2'

The latest version at the time of this writing.

The accepted answer for this thread was outdated.

Add following two dependencies in your build.gradle(Module: app)

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

try including compile 'com.google.android.gms:play-services-places:10.2.0'

compile 'com.google.android.gms:play-services-location:7.5.0'

Just add it in your dependency (build.gradle [Module:Application]) Then file -> Invalidate caches/restart-> invalidate and Restart

For latest versions of google play services for location changes have been made. Check [Selective Google Play Services API not finding classes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!