Baseflow / flutter-geocoding

A Geocoding plugin for Flutter
https://baseflow.com
MIT License
136 stars 71 forks source link

PlatformException(IO_ERROR, grpc failed, null, null)[Bug]: #212

Closed zhengxiangke closed 6 months ago

zhengxiangke commented 7 months ago

Please check the following before submitting a new issue.

Please select affected platform(s)

Steps to reproduce

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(IO_ERROR, grpc failed, null, null) E/flutter (12578): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:651:7) E/flutter (12578): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:322:18) E/flutter (12578): E/flutter (12578): #2 GeocodingAndroid.placemarkFromCoordinates (package:geocoding_android/geocoding_android.dart:72:9) E/flutter (12578): E/flutter (12578): #3 _GeocodeWidgetState.build.. (package:geocoding_example/main.dart:81:29) E/flutter (12578):

android

Expected results

final latitude = double.parse(_latitudeController.text); final longitude = double.parse(_longitudeController.text);

              placemarkFromCoordinates(latitude, longitude)
                  .then((placemarks) {
                var output = 'No results found.';
                if (placemarks.isNotEmpty) {
                  output = placemarks[0].toString();
                }

                setState(() {
                  _output = output;
                });
              });

Actual results

返回地址

Code sample

final latitude = double.parse(_latitudeController.text); final longitude = double.parse(_longitudeController.text);

              placemarkFromCoordinates(latitude, longitude)
                  .then((placemarks) {
                var output = 'No results found.';
                if (placemarks.isNotEmpty) {
                  output = placemarks[0].toString();
                }

                setState(() {
                  _output = output;
                });
              });

Screenshots or video

image

Version

geocoding: ^2.2.0

Flutter Doctor output

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(IO_ERROR, grpc failed, null, null) E/flutter (12578): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:651:7) E/flutter (12578): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:322:18) E/flutter (12578): E/flutter (12578): #2 GeocodingAndroid.placemarkFromCoordinates (package:geocoding_android/geocoding_android.dart:72:9) E/flutter (12578): E/flutter (12578): #3 _GeocodeWidgetState.build.. (package:geocoding_example/main.dart:81:29) E/flutter (12578):

TimHoogstrate commented 7 months ago

Dear @zhengxiangke,

Thanks for your issue. I've looked into the issue and according to the README the following could be happening:

1. This plugin uses the free Geocoding services provided by the iOS and Android platforms. This means that there are restrictions to their use. More information can be found in the [Apple documentation for iOS](https://developer.apple.com/documentation/corelocation/clgeocoder) and the [Google documentation for Android](https://developer.android.com/reference/android/location/Geocoder).
   When a `PlatformException(IO_ERROR, ...)` gets thrown, most of the times it means that the rate limit has been reached.
2. The availability of the Google Play Services depends on your country. If your country doesn't support a connection with the Google Play Services, you'll need to try a VPN to establish a connection. For more information about how to work with Google Play Services visit the following link: https://developers.google.com/android/guides/overview 

Can you check if one of the issues may apply to your situation?

Kind regards,

github-actions[bot] commented 6 months ago

Without additional information, we are unfortunately not able to resolve this issue. Therefore, we reluctantly closed this issue for now. If you run into this issue later, feel free to file a new issue with a reference to this issue. Add a description of detailed steps to reproduce, expected and current behaviour, logs and the output of 'flutter doctor -v'. Thanks for your contribution.