0

GoogleプレイスのオートコンプリートAPIを使って作業していたのは、しかしエラーが発生しても、エラーコールバックにはerror code : 0とステータスがSuccessのエラーメッセージが表示されます。私はgoogle place autocomplete Fragmentを使用しています。GoogleプレイスAPIエラーですが、成功を返します

プリントアウトエラー:I/DESTINATION: An error occurred: SUCCESS

private void setDestinationAutocompleteCallbacks() { 
    DestinationautocompleteFragment.setOnPlaceSelectedListener(new PlaceSelectionListener() { 
     @Override 
     public void onPlaceSelected(Place place) { 
     LatLng destinationLatLng = place.getLatLng(); 
     OriginAndDestinationLocations[1] = destinationLatLng; 

     mMap.addMarker(new MarkerOptions() 
      .position(destinationLatLng) 
      .title(getString(R.string.destinationLocation)) 
      .snippet(place.getAddress().toString())) 
      .showInfoWindow(); 

     if (OriginAndDestinationLocations[0] != null) { 
      adjustZoom(); 
     } else { 
      mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(destinationLatLng, Zoom), 2000, null); 
     } 
     } 

     @Override 
     public void onError(Status status) { 
     Log.i(DESTINATIONTAG, "An error occurred: " + status.getStatusMessage()); 
     } 
    }); 
} 

答えて

0

はマニフェスト

<meta-data android:name="com.google.android.geo.API_KEY" android:value="YOUR_API_KEY"/> 

をチェックあなたはアンドロイドでは、複数のアプリケーションで同じGoogleのAPIキーを使用するかもしれません。ので、他のアプリケーションからGoogleのAPIキーを削除します。 別の方法は、現在のアプリケーション用に新しいapiキーを生成することです。

関連する問題