简体   繁体   中英

How to get Current Location in Google Maps

I am using android studio version 3.3.1 and working on google map code for getting the current location. When I am adding permission in gradle.build file then I have got an error.

This file I am adding: ......................................................................

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

Got these error while I syn the gradle:

ERROR: Failed to resolve: com.google.android.gms:play-services-location:16.1.0

Install Repository and sync project

Show in Project Structure dialog

Affected Modules: app

WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'. It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html Affected Modules: app

....................................................................

When I click the error of "Install Repository and sync project" the got could not find dependencies.

The latest version for that dependency is 16.0.0. You're using 16.1.0 which doesn't exist for the location services package.

Google Location and Activity Recognition com.google.android.gms:play-services-location:16.0.0

有16.0.1,您可以使用16.0.0或升级到现在(17.0.0)的最新版本。 此处提供完整的发行列表。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM