Google Places api AutocompletePrediction prediction.getDescription() MissingAfter upgrading to Play services to 9.4.0

Google Places api AutocompletePrediction prediction.getDescription() MissingAfter upgrading to Play services to 9.4.0

由于 firebase,我将播放服务升级到 9.4.0 后,因为它必须为 firebase 添加最新版本 9.0.0 或更高版本,我面临问题,因为现在显示 AutocompletePrediction prediction.getDescription()由于在我的项目中没有找到,除了 Gradle 更新之外我没有改变任何东西,我认为新的播放服务缺少 .getDescription 方法,请帮助我 这是我的新 Gradle ` 编译 'com.google.firebase:firebase-core:9.4.0'

compile 'org.osmdroid:osmdroid-android:5.1@aar'
compile 'com.github.MKergall.osmbonuspack:OSMBonusPack:v5.7'
compile 'com.google.android.gms:play-services:9.4.0'
compile 'com.google.android.gms:play-services-ads:9.4.0'
compile 'com.google.android.gms:play-services-identity:9.4.0'
compile 'com.google.android.gms:play-services-gcm:9.4.0'

} 应用插件:'com.google.gms.google-services' and this one is my java file where >getDescription is missing public PlaceAutocomplete getItem(int position) { return mResultList.get(位置); }

private ArrayList<PlaceAutocomplete> getPredictions(CharSequence constraint) {
    if (mGoogleApiClient != null) {
        Log.i(TAG, "Executing autocomplete query for: " + constraint);
        PendingResult<AutocompletePredictionBuffer> results =
                Places.GeoDataApi
                        .getAutocompletePredictions(mGoogleApiClient, constraint.toString(),
                                mBounds, mPlaceFilter);
        // Wait for predictions, set the timeout.
        AutocompletePredictionBuffer autocompletePredictions = results
                .await(60, TimeUnit.SECONDS);
        final Status status = autocompletePredictions.getStatus();
        if (!status.isSuccess()) {
            Toast.makeText(getContext(), "Error: " + status.toString(),
                    Toast.LENGTH_SHORT).show();
            Log.e(TAG, "Error getting place predictions: " + status
                    .toString());
            autocompletePredictions.release();
            return null;
        }

        Log.i(TAG, "Query completed. Received " + autocompletePredictions.getCount()
                + " predictions.");
        Iterator<AutocompletePrediction> iterator = autocompletePredictions.iterator();
        ArrayList resultList = new ArrayList<>(autocompletePredictions.getCount());
        while (iterator.hasNext()) {
            AutocompletePrediction prediction = iterator.next();
            resultList.add(new PlaceAutocomplete(prediction.getPlaceId(),
                    prediction.getDescription()));
        }
        // Buffer release
        autocompletePredictions.release();
        return resultList;
    }
    Log.e(TAG, "Google API client is not connected.");
    return null;
}`

getDescription 已弃用,如 Google 文档所述。

getDescription() 现已弃用。 请使用 getFullText()、getPrimaryText()、and/or getSecondaryText() 检索完整或部分描述, getMatchedSubstrings() 现已弃用。请使用 getFullText() 更轻松地格式化匹配项。 https://developers.google.com/android/guides/releases