flutter-geocoding icon indicating copy to clipboard operation
flutter-geocoding copied to clipboard

PlatformException(IO_ERROR, Service not Available, null, null)[Question]:

Open Omo-oba18 opened this issue 1 year ago • 1 comments

Please check the following before submitting a new issue.

Please select for which platform(s) you need help

  • [X] Android
  • [x] iOS

Your question

I have implemented the geocoding library some months ago and it was working fine, I could get the location successufully but now, I am having some Service not available error I wonder why this error occured now!

`Future _getAddressFromLatLng(Position position) async {

try {
  List<Placemark> placemarks = await placemarkFromCoordinates(
    position.latitude,
    position.longitude,
    //   52.2165157, 6.9437819
  );

  if (placemarks.isNotEmpty) {
    Placemark place = placemarks[0];
    _currentAddress =
        '${place.street}, ${place.subLocality}, ${place.subAdministrativeArea}, ${place.postalCode}';
  }
} on PlatformException catch (e) {
  // Handle specific platform exceptions
  logger.e("Platform Exception: $e");
  _currentAddress = "Address Unavailable";
} catch (e) {
  // Catch any other exceptions
  logger.e("Error fetching address: $e");
  _currentAddress = "Address Unavailable";
}

} `

I added the google map API key in the AndroidManifest.xml and the ACCESS_FINE_LOCATION is added too! Months ago, I was testing with Samsung galaxy s9+, but nowadays, I am using Android 8.1 (oreo)

Can someone assist me? I want to know what I am doing wrong!

android-manifest

Error: I/flutter (14829): ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── I/flutter (14829): │ #0 LocationProvider._getAddressFromLatLng (package:stemir/src/provider/location_provider.dart:96:14) I/flutter (14829): │ #1 <asynchronous suspension> I/flutter (14829): ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄ I/flutter (14829): │ ⛔ Platform Exception: PlatformException(IO_ERROR, Service not Available, null, null) I/flutter (14829): └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Version

3.0.0

Omo-oba18 avatar Apr 26 '24 10:04 Omo-oba18

I am also facing this issue...

yubraja avatar Jun 29 '24 03:06 yubraja

@Omo-oba18,

Did you resolve the issue?

Kind regards,

TimHoogstrate avatar Jul 30 '24 07:07 TimHoogstrate

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.

github-actions[bot] avatar Aug 13 '24 08:08 github-actions[bot]