2017-10-14 15 views
0
PlacePicker.IntentBuilder builder = new PlacePicker.IntentBuilder(); 
startActivityForResult(builder.build(MainActivity.this), PLACE_PICKER_REQUEST); 

私はこのソースコードを使用していますが、このようなbuilder.build(MainActivity.this)でエラーがあります:置きAPIエラー:未処理の例外

Unhandled exceptions: com.google.android.gms.common.GooglePlayServicesRepairableException, com.google.android.gms.common.GooglePlayServicesNotAvailableException

私はそれの機能のAPI(bulid.gradlecompile 'com.google.android.gms:play-services-places:11.4.2')ことを確認しました。どうすれば修正できますか?

答えて

1

携帯端末でGoogle Playサービスを有効/更新/アップグレードするだけです。それはofficial documentationで書かれているとおり

生産段階で最高のソリューションです:私の電話で

GooglePlayServicesRepairableExceptions are special instances of UserRecoverableExceptions which are thrown when Google Play Services is not installed, up-to-date, or enabled. In these cases, client code can use getConnectionStatusCode() in conjunction with getErrorDialog(android.app.Activity, int, int) to provide users with a localized Dialog that will allow users to install, update, or otherwise enable Google Play services.

+0

...?コンパイル中です。 'Error:(55,53)error:報告されていない例外GooglePlayServicesRepairableException;捕まえられなければならない、またはスローされると宣告されなければなりません。 –

+0

...私はエラーメッセージを無視しました。それを私が直した。ありがとう! –

+0

もっと具体的に次回 – Thecave3