1

这是我
添加了 PlaceAutocompleteFragment 的 .xml 文件,但它显示了未解析的类 PlaceAutocompleteFragment。我检查了依赖文件,所有东西都添加了。

<fragment
        android:id="@+id/autocomplete_fragment"
        android:name="com.google.android.gms.location.places.ui.PlaceAutocompleteFragment"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

这是我的毕业典礼。我不知道我的错误在哪里,请验证我的代码并告诉我错误在哪里。

implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.google.android.gms:play-services-maps:11.8.0'
    implementation 'com.google.android.gms:play-services-location:11.8.0'
    testImplementation 'junit:junit:4.12'
    testImplementation 'com.android.support.test:runner:1.0.1'
    testImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
4

1 回答 1

2

您必须添加此依赖项,它用于 google 地方

compile 'com.google.android.gms:play-services-places:11.8.0'
于 2018-01-09T11:59:46.440 回答