简体   繁体   English

无法在android studio中找到LatLng导入

[英]cant find LatLng import in android studio

When i try to use LatLng class in my code, there is no import available. 当我尝试在我的代码中使用LatLng类时,没有可用的导入。 could anyone please solve the problem? 有谁可以请解决问题? i've installed google play services module thriugh SDK manager also. 我已经安装了谷歌播放服务模块thriugh SDK经理。

Its available in 它可用于

compile 'com.google.android.gms:play-services-maps:9.6.0' 编译'com.google.android.gms:play-services-maps:9.6.0'

You can replace the version with the latest one available. 您可以使用最新版本替换该版本。

LatLng位于com.google.android.gms.maps.model package ,如果您将implementation 'com.google.android.gms:play-services-maps:15.0.1'到gradle依赖项,则可以使用该com.google.android.gms.maps.model package

include this into your app build.gradle file 将其包含在您的app build.gradle文件中

 apply plugin: 'com.android.application'

...

dependencies {
    implementation 'com.google.android.gms:play-services-maps:15.0.1'
}

for more information take a look to developers.google.com 有关更多信息,请访问developers.google.com

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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