找不到符号类AutocompletePrediction

时间:2016-09-23 08:21:10

标签: android

我将我的gms版本从8.4.0升级到9.6.0。在Sync Now之后我打破了很多东西。 AutocompletePrediction是否已在9.6.0版本中删除?

升级前:

compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.google.android.gms:play-services-maps:8.4.0'
compile 'com.google.android.gms:play-services-location:8.4.0'
compile 'com.google.android.gms:play-services-analytics:8.4.0'

升级后:

compile 'com.google.android.gms:play-services-gcm:9.6.0'
compile 'com.google.android.gms:play-services-maps:9.6.0'
compile 'com.google.android.gms:play-services-location:9.6.0'
compile 'com.google.android.gms:play-services-analytics:9.6.0'

堆栈跟踪:

Error:(15, 46) error: cannot find symbol class AutocompleteFilter
Error:(16, 46) error: cannot find symbol class AutocompletePrediction
Error:(17, 46) error: cannot find symbol class AutocompletePredictionBuffer
Error:(18, 46) error: cannot find symbol class Places
Error:(48, 13) error: cannot find symbol class AutocompleteFilter
Error:(51, 83) error: cannot find symbol class AutocompleteFilter
Error:(110, 23) error: cannot find symbol class AutocompletePrediction
Error:Execution failed for task ':app:compileClientReleaseJavaWithJavac'.
Compilation failed; see the compiler error output for details.

1 个答案:

答案 0 :(得分:6)

除了添加play-services-location库之外,还需要添加play-services-places库,因为Places和Autocomplete类已经移动到该库,在我的情况下我使用

compile 'com.google.android.gms:play-services-places:9.6.1'