【发布时间】:2016-06-27 21:36:16
【问题描述】:
我正在尝试编写一个简单的程序,该程序涉及使用PlacePicker 来捕获位置信息。但是,我的项目似乎无法解决必要的导入问题。
build.gradle:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.google.android.gms:play-services-location:9.2.0'
compile 'com.google.android.gms:play-services-maps:9.2.0'
}
活动:
import com.google.android.gms.location.places.Place; // "Place" is not resolved
import com.google.android.gms.location.places.ui.PlacePicker; // "ui" is not resolved
import com.google.android.gms.maps.model.LatLng;
LatLng 导入似乎有效,但其他两个无效。当我导入完整的com.google.android.gms:play-services:9.2.0 API 时,整个项目运行良好,但我想使用特定的 API 调用来减少不必要的库。
【问题讨论】:
-
“整个项目运行良好”是什么意思?你不是要导入完整的地图包吗?
-
@cricket_007 - 看起来我最初的问题有误。我的意思是说它只有在我导入完整的谷歌播放服务包(即地图、位置、身份验证、身份、健身等)时才有效,这是我不需要的大量库。我将编辑问题。