我正在尝试使用 Street View API 实现自动完成地点搜索。 我以下是我的依赖项:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.google.android.gms:play-services-maps:11.0.4'
testCompile 'junit:junit:4.12'
}
元数据如下:
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_key" />
我已经安装了所有必需的 SDK,但我的 android studio 无法解析以下导入中的位置部分:
import com.google.android.gms.location.places.Place;
import com.google.android.gms.location.places.ui.PlaceAutocomplete;
它是这样的: Error
最佳答案
在gradle文件中添加这个依赖
compile 'com.google.android.gms:play-services-places:9.2.0'
关于java - android studio 无法解析import com.google.android.gms.location.places.Place;,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46682734/