仮想デバイスのGoogle Playサービスに関連しています。 解決策としてAPI25とバージョン7.1.1を使用してください。
ここに例を示します。
私はGenymotionとGoogleでを試しサービスは、仮想デバイス上の無効になっている再生は(エラー:サービス利用可能ではない):
10-07 07:13:30.023 3481-3481/com.unalfaruk.mapexample I/System.out: Your Location: 65.96992333333333 -18.540028333333332
10-07 07:13:30.023 3481-3481/com.unalfaruk.mapexample W/System.err: java.io.IOException: Service not Available
10-07 07:13:30.024 3481-3481/com.unalfaruk.mapexample W/System.err: at android.location.Geocoder.getFromLocation(Geocoder.java:136)
10-07 07:13:30.024 3481-3481/com.unalfaruk.mapexample W/System.err: at com.unalfaruk.mapexample.MapsActivity$1.onLocationChanged(MapsActivity.java:71)
10-07 07:13:30.024 3481-3481/com.unalfaruk.mapexample W/System.err: at android.location.LocationManager$ListenerTransport._handleMessage(LocationManager.java:297)
私はサービスを再生GenymotionとGoogleでを試してみてくださいは有効です(エラー:grpcが失敗しました):
10-07 07:18:56.325 2694-2694/com.unalfaruk.mapexample I/System.out: Your Location: 65.96669666666666 -15.0
10-07 07:18:57.670 2694-2694/com.unalfaruk.mapexample W/System.err: java.io.IOException: grpc failed
10-07 07:18:57.670 2694-2694/com.unalfaruk.mapexample W/System.err: at android.location.Geocoder.getFromLocation(Geocoder.java:136)
10-07 07:18:57.670 2694-2694/com.unalfaruk.mapexample W/System.err: at com.unalfaruk.mapexample.MapsActivity$1.onLocationChanged(MapsActivity.java:71)
10-07 07:18:57.670 2694-2694/com.unalfaruk.mapexample W/System.err: at android.location.LocationManager$ListenerTransport._handleMessage(LocationManager.java:297)
私はAVD Managerでを試してみて、Googleがサービスを再生(エラーなし)が有効になっているに:
10-07 14:20:14.769 3159-3159/com.unalfaruk.mapexample I/System.out: Your Location: 37.421998333333335 -122.08400000000002
10-07 14:20:15.220 3159-3159/com.unalfaruk.mapexample I/System.out: Your Adress: Address[addressLines=[0:"1600 Amphitheatre Parkway",1:"Mountain View, CA 94043",2:"USA"],feature=1600,admin=California,sub-admin=null,locality=Mountain View,thoroughfare=Amphitheatre Parkway,postalCode=94043,countryCode=US,countryName=United States,hasLatitude=true,latitude=37.422329,hasLongitude=true,longitude=-122.0843055,phone=null,url=null,extras=null]
の可能性のある重複した[にjava.io.IOException:grpcに失敗しました]( https://stackoverflow.com/questions/45012289/java-io-ioexception-grpc-failed) –
@SimonRolinいいえ、受け入れられた回答とその下のコメントを参照してください。 –