当我尝试在我的代码中使用LatLng类时,没有可用的导入。有人能解决这个问题吗?我已经通过SDK管理器安装了Google Play服务模块。
它可以在以下地方找到:
compile 'com.google.android.gms:play-services-maps:9.6.0'
你可以用最新的版本替换它。
LatLng位于com.google.android.gms.maps.model
包中,如果您在gradle依赖项中添加implementation 'com.google.android.gms:play-services-maps:15.0.1'
,则可以使用它。
apply plugin: 'com.android.application'
...
dependencies {
implementation 'com.google.android.gms:play-services-maps:15.0.1'
}
了解更多信息,请查看developers.google.com
classpath 'com.google.gms:google-services:3.0.0'
添加到build.gradle(project)的buildscript依赖项中,并将apply plugin: 'com.google.gms.google-services'
添加到build.gradle(app)底部 - Tim