Code Monkey home page Code Monkey logo

flutter_geocoder's Introduction

Really sorry for the lack of updates. I'm currently really busy and can't really give you an ETA for the next release.

In the meantime, you can try the geocoding package which should offer almost the same functionnalities.

geocoder

Forward and reverse geocoding.

Usage

Import package:geocoder/geocoder.dart, and use the Geocoder.local to access geocoding services provided by the device system.

Example:

import 'package:geocoder/geocoder.dart';

// From a query
final query = "1600 Amphiteatre Parkway, Mountain View";
var addresses = await Geocoder.local.findAddressesFromQuery(query);
var first = addresses.first;
print("${first.featureName} : ${first.coordinates}");

// From coordinates
final coordinates = new Coordinates(1.10, 45.50);
addresses = await Geocoder.local.findAddressesFromCoordinates(coordinates);
first = addresses.first;
print("${first.featureName} : ${first.addressLine}");

You can alternatively use Geocoder.google member for requesting distant data from google services instead of native ones.

You will find links to the API docs on the pub page.

Getting Started

For help getting started with Flutter, view our online documentation.

For help on editing plugin code, view the documentation.

flutter_geocoder's People

Contributors

aloisdeniel avatar arlucio avatar bcko avatar eimji avatar tehsunnliu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flutter_geocoder's Issues

Multiple Async "findAddressesFromCoordinates" at the Same Time Not Supported?

In the following code, SUCCESS 1 but not SUCCESS 2 is printed out:

final coordinates1 = Coordinates(..., ...);
Geocoder.local.findAddressesFromCoordinates(coordinates1).then((_) {
  print('SUCCESS 1');
});
final coordinates2 = Coordinates(..., ...);
Geocoder.local.findAddressesFromCoordinates(coordinates2).then((_) {
  print('SUCCESS 2');
});

But in this code, both are printed out:

final coordinates1 = Coordinates(..., ...);
final coordinates2 = Coordinates(..., ...);
Geocoder.local.findAddressesFromCoordinates(coordinates1).then((_) {
  print('SUCCESS 1');
  Geocoder.local.findAddressesFromCoordinates(coordinates2).then((_) {
    print('SUCCESS 2');
  });
});

So apparently, findAddressesFromCoordinates does not support multiple async calls at the same time. Is it possible to do so?

inheritFromWidgetOfExactType isn't defined.

static AppState of(BuildContext context) {
    return context.inheritFromWidgetOfExactType(AppState);
  }

The method 'inheritFromWidgetOfExactType' isn't defined for the type 'BuildContext'.
Try correcting the name to the name of an existing method, or defining a method named 'inheritFromWidgetOfExactType'.dart(undefined_method)

GeocoderPlugin.java uses or overrides a deprecated API.

As of today:

command: flutter build appbundle

/.pub-cache/hosted/pub.dartlang.org/geocoder-0.2.1/android/src/main/java/com/aloisdeniel/geocoder/GeocoderPlugin.java uses or overrides a deprecated API.

Platform and Details

[✓] Flutter (Channel stable, 2.0.3, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Android Studio
[✓] VS Code (version 1.55.2)
Flutter (Channel stable, 2.0.3, on Linux, locale en_US.UTF-8)
    • Flutter version 2.0.3 at /home/path/Android/fluttersdk/flutter
    • Framework revision 4d7946a68d (7 weeks ago), 2021-03-18 17:24:33 -0700
    • Engine revision 3459eb2436
    • Dart version 2.12.2

xCode fails to import geocoder when trying to build onto physical device.

Hi!

When I build my app on a virtual device, it works fine, but when I try to build it through xCode I get this error:

`#if __has_include(<geocoder/GeocoderPlugin.h>)
#import <geocoder/GeocoderPlugin.h>
#else
@import geocoder;
#endif
#if __has_include(<google_maps_flutter/FLTGoogleMapsPlugin.h>)
#import <google_maps_flutter/FLTGoogleMapsPlugin.h>
#else
@import google_maps_flutter;
#endif
@implementation GeneratedPluginRegistrant

  • (void)registerWithRegistry:(NSObject*)registry {
    [GeocoderPlugin registerWithRegistrar:[registry registrarForPlugin:@"GeocoderPlugin"]];
    [FLTGoogleMapsPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTGoogleMapsPlugin"]];
    }
    @end`

Exception in Geocoder.google

Trying to use Geocoder.google` I get this exception on Android:

E/flutter ( 4124): [ERROR:topaz/lib/tonic/logging/dart_error.cc(16)] Unhandled exception:
E/flutter ( 4124): type 'List' is not a subtype of type 'List<Map<dynamic, dynamic>>'
E/flutter ( 4124): #0 GoogleGeocoding._send (package:geocoder/services/distant_google.dart:42:29)
E/flutter ( 4124):
E/flutter ( 4124): #1 GoogleGeocoding.findAddressesFromCoordinates

Calling function findAddressesFromCoordinates() throws MissingPluginException

I came across this plugin to satisfy my need of getting a formatted address for my geo coordinates. Included package in my YAML file and wrote the sample code sending sample but authentic coordinates and I was given the following error when calling the function findAddressesFromCoordinates()

MissingPluginException(No implementation found for method findAddressesFromCoordinates on channel github.com/aloisdeniel/geocoder)
#0 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:278:7) E/flutter ( 9718): <asynchronous suspension>
E/flutter ( 9718): #1 LocalGeocoding.findAddressesFromCoordinates (package:geocoder/services/local.dart:13:41) E/flutter ( 9718): <asynchronous suspension>

I stopped debugging, and fresh started, but to no avail. Help!

Individual address line

Currently all address lines are concatenated together (separated by ", ") and then passed back.
To get individual parts, one need to split the result text.

Please just pass them individually. If needed, the user of the library can concat the parts him self.

gprc failed on Android product app

getFromLocation --- latitude = 23.XXXXXXX, longitude = 86.XXXXXXX, maxResults = 1
Geocoder getFromLocation --- mService = android.location.ILocationManager$Stub$Proxy@232c132, ex = grpc failed, return results = []

PlatformException(ERROR_GEOCODING_COORDINATES, grpc failed, null);

Please Fix this issue because we are using in production app

Throws exception when trying to run Geocoder.local.findAddressesFromCoordinates(coordinates) only on Android

E/AndroidRuntime(20142): java.lang.RuntimeException: An error occurred while executing doInBackground()
E/AndroidRuntime(20142): at android.os.AsyncTask$3.done(AsyncTask.java:354)
E/AndroidRuntime(20142): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
E/AndroidRuntime(20142): at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
E/AndroidRuntime(20142): at java.util.concurrent.FutureTask.run(FutureTask.java:271)
E/AndroidRuntime(20142): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
E/AndroidRuntime(20142): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/AndroidRuntime(20142): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/AndroidRuntime(20142): at java.lang.Thread.run(Thread.java:764)
E/AndroidRuntime(20142): Caused by: java.lang.RuntimeException: Methods marked with @UiThread must be executed on the main thread. Current thread: AsyncTask #2
E/AndroidRuntime(20142): at io.flutter.embedding.engine.FlutterJNI.ensureRunningOnMainThread(FlutterJNI.java:794)
E/AndroidRuntime(20142): at io.flutter.embedding.engine.FlutterJNI.invokePlatformMessageResponseCallback(FlutterJNI.java:727)
E/AndroidRuntime(20142): at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:140)
E/AndroidRuntime(20142): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success(MethodChannel.java:225)
E/AndroidRuntime(20142): at com.aloisdeniel.geocoder.GeocoderPlugin$2.doInBackground(GeocoderPlugin.java:109)
E/AndroidRuntime(20142): at com.aloisdeniel.geocoder.GeocoderPlugin$2.doInBackground(GeocoderPlugin.java:102)
E/AndroidRuntime(20142): at android.os.AsyncTask$2.call(AsyncTask.java:333)
E/AndroidRuntime(20142): at java.util.concurrent.FutureTask.run(FutureTask.java:266)
E/AndroidRuntime(20142): ... 4 more
D/EGL_emulation(20142): eglMakeCurrent: 0xe8be2640: ver 3 0 (tinfo 0xe4c682b0)
E/BufferQueueProducer(20142): [SurfaceTexture-0-20142-0] setAsyncMode: BufferQueue has been abandoned
E/BufferQueueProducer(20142): [SurfaceTexture-0-20142-0] queueBuffer: BufferQueue has been abandoned
E/BufferQueueProducer(20142): [SurfaceTexture-0-20142-0] dequeueBuffer: BufferQueue has been abandoned
E/BufferQueueProducer(20142): [SurfaceTexture-0-20142-0] setAsyncMode: BufferQueue has been abandoned
W/System (20142): A resource failed to call release.

Missing Plugin Exception

Im using geocoder on iOS and I'm getting this message on screen. MissingPluginException(No implementation found for method findAddressesFromQuery on channel github.com/aloisdeniel/geocoder). How do I fix this?

PlatformException when calling Geocoder.local.findAddressesFromQuery

Hello everybody!
I regularly use this plugin for building production applications; but i've recently been notified by a customer of a bug on an app, [...], below is the error shown in the console

E/flutter (12189): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: PlatformException(failed, Failed, null)
�[38;5;244mE/flutter (12189): #0      StandardMethodCodec.decodeEnvelope�[39;49m
�[38;5;244mE/flutter (12189): #1      MethodChannel.invokeMethod�[39;49m
E/flutter (12189): <asynchronous suspension>
�[38;5;248mE/flutter (12189): #2      LocalGeocoding.findAddressesFromQuery�[39;49m
E/flutter (12189): <asynchronous suspension>
�[38;5;248mE/flutter (12189): #3      HomePageState.searchByLocality�[39;49m
E/flutter (12189): <asynchronous suspension>
�[38;5;248mE/flutter (12189): #4      HomePageState.build.<anonymous closure>.<anonymous closure>�[39;49m
E/flutter (12189): <asynchronous suspension>
�[38;5;244mE/flutter (12189): #5      _InkResponseState._handleTap�[39;49m
�[38;5;244mE/flutter (12189): #6      _InkResponseState.build.<anonymous closure>�[39;49m
�[38;5;244mE/flutter (12189): #7      GestureRecognizer.invokeCallback�[39;49m
�[38;5;244mE/flutter (12189): #8      TapGestureRecognizer._checkUp�[39;49m
�[38;5;244mE/flutter (12189): #9      TapGestureRecognizer.acceptGesture�[39;49m
�[38;5;244mE/flutter (12189): #10     GestureArenaManager.sweep�[39;49m
�[38;5;244mE/flutter (12189): #11     _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent�[39;49m
�[38;5;244mE/flutter (12189): #12     _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent�[39;49m
�[38;5;244mE/flutter (12189): #13     _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent�[39;49m
�[38;5;244mE/flutter (12189): #14     _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue�[39;49m
�[38;5;244mE/flutter (12189): #15     _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket�[39;49m
�[38;5;244mE/flutter (12189): #16     _rootRunUnary  (dart:async/zone.dart:1136:13)�[39;49m
�[38;5;244mE/flutter (12189): #17     _CustomZone.runUnary  (dart:async/zone.dart:1029:19)�[39;49m
�[38;5;244mE/flutter (12189): #18     _CustomZone.runUnaryGuarded  (dart:async/zone.dart:931:7)�[39;49m
�[38;5;244mE/flutter (12189): #19     _invoke1  (dart:ui/hooks.dart:250:10)�[39;49m
�[38;5;244mE/flutter (12189): #20     _dispatchPointerDataPacket  (dart:ui/hooks.dart:159:5)�[39;49m

Can't get addresses

About 2 hours ago it was working, now it does not :/

D/Geocoder(24562): getFromLocation --- latitude = {some latitude}, longitude = {some_longitude}, maxResults = 20
D/Geocoder(24562): Geocoder getFromLocation --- mService = android.location.ILocationManager$Stub$Proxy@e889724, ex = grpc failed, return results = []

this is the code I use:

final List<Address> addresses =
        await Geocoder.local.findAddressesFromCoordinates(
      Coordinates(
        double.parse(latLng.latitude.toStringAsFixed(3)),
        double.parse(latLng.longitude.toStringAsFixed(3)),
      ),
    );

GeoCoder giving two different addresslines in IOS and Android Platforms

while i'm trying geocoder same code in different platforms (IOS and Android), returning two diferent addresslines for the same co-ordinates

Flutter (Channel stable, 2.0.4, on Mac OS X 10.15.6 19G2021 darwin-x64, locale en-IN)

my code
final coordinates = geocoder.Coordinates(
79.766703732386, 17.79392640108037);
var addresses = await geocoder.Geocoder.local
.findAddressesFromCoordinates(coordinates);

Not working on newer devices

Hello, I'm using geocoder: ^0.2.1 this plugin. This is working fine on lower version devices but not working on the above version 9.0 devices. Please let me know the solution.

Getting address size 0 with google method

Hi i am using this:

var addresses=await Geocoder.google("APIKEYHERE",language: "en").findAddressesFromCoordinates(coordinates)".

But it always return "addresses" variable size "0".

Can you please help me out why address is not getting return.

Geocoder.google not working

Hi, I have enable the Geocoding api on Google Cloud Platform in order to use it over Geocoder.Google. It looks everything working on the Google side but when i try to bring the data it shows error and doesn't return anything.

` final coordinates = new Coordinates(-12.0785151, -77.0557978);

var addresses =
    await Geocoder.google(apikey)
        .findAddressesFromCoordinates(coordinates);
var ad = addresses.first;
print(ad.toMap());`

I got this on my terminal

Performing hot restart...
Restarted application in 1,037ms.
flutter: distrito
[VERBOSE-2:ui_dart_state.cc(144)] Unhandled Exception: Bad state: No element
#0 List.first (dart:core-patch/growable_array.dart:220:5)
#1 _MyHomePageState.getDistrict (package:google_maps/main.dart:38:24)

#2 _MyHomePageState.initState (package:google_maps/main.dart:54:5)
#3 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4085:58)
#4 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3936:5)
#5 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3109:14)
#6 Element.updateChild (package:flutter/src/widgets/framework.dart:2903:12)
#7 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5165:14)
#8 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3109:14)
#9 Element.updateChild (package:flutter/src/widgets/framework.dart:2903:12)
#10 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3978:16)
#11 Ele<…>
[C3.1 BF945B7C-A3F8-43B8-9922-CE812241D441 192.168.1.16:53918<->172.217.8.78:443]
Connected Path: satisfied (Path is satisfied), interface: en0
Duration: 68.995s, DNS @0.000s took 1.039s, TCP @1.041s took 0.072s, TLS took 0.179s
bytes in/out: 4659/1725, packets in/out: 14/12, rtt: 0.074s, retransmitted packets: 0, out-of-order packets: 0
[C4.1 C628BB9C-C2AF-4FFB-ADDB-57DCE7EE6F35 192.168.1.16:54192<->172.217.8.138:443]
Connected Path: satisfied (Path is satisfied), interface: en0
Duration: 0.404s, DNS @0.000s took 0.019s, TCP @0.021s took 0.081s, TLS took 0.196s
bytes in/out: 4844/1475, packets in/out: 10/9, rtt: 0.078s, retransmitted packets: 0, out-of-order packets: 0

image

[Question/Discussion] Can we have time zone from a given Coordinates, City Name or Country Code?

For Example: If I search "Istanbul", local() will give us major address information i.e. City, Country, Coordinates.
What If we want to translate a query to a timezone? is it possible within the scope of this library?

Wiki: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones

Above wiki provide a list which also contains the country code field which relate to corresponding time zone.

From this library we can get country code so I was thinking that is it possible within this library to expose a time zone field using country codes.

Also, timezone provide zone location using only the zone name string in olson format. Tz Database Wiki i.e. 'America/Detroit'.

I am wondering if there is anyway we can translate simple city name or country codes to time zones. I think of a manual solution for my specific problem but if we could provide through a public dart library such as this.

Please advise.

Error when trying to run application for the first time

I am getting an error when I am trying to run this for the first time.
Not sure how to fix this one as Google doesn't give much information.

`Error running Gradle:
ProcessException: Process "/Users/mattlist/Downloads/geocoding_test/example/android/gradlew" exited abnormally:
FAILURE: Build failed with an exception.

  • Where:
    Script '/Users/mattlist/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 193
  • What went wrong:
    A problem occurred configuring project ':geocoding_test'.

Failed to notify project evaluation listener.
Could not get unknown property 'android' for project ':geocoding_test' of type org.gradle.api.Project.
Could not find method debugProvided() for arguments [file collection] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
  • Get more help at https://help.gradle.org
    BUILD FAILED in 1s
    Command: /Users/mattlist/Downloads/geocoding_test/example/android/gradlew app:properties
    Please review your Gradle project setup in the android/ folder.`

how to manipulate lat and long as a string ?

Hello I tried to display lat and long from an adresse. but I don't succeded with the example to manipulate lat long as a string to display in a Text()

If there is a simple example to just enter an address and display coordinate in a Text function

thank you

JavaRuntimeException

The line marked with asterik seems to be caused because of the geocoder plugin when used with flutter_google_places plugin

Restarted application in 2,320ms.
W/ResourceType(12219): No package identifier when getting name for resource number 0x00000000
I/Google Maps Android API(12219): Google Play services package version: 17455021
I/art     (12219): Do full code cache collection, code=506KB, data=486KB
I/art     (12219): After code cache collection, code=490KB, data=447KB
W/ResourceType(12219): No package identifier when getting name for resource number 0x00000000
W/ResourceType(12219): No package identifier when getting name for resource number 0x00000000
E/AndroidRuntime(12219): FATAL EXCEPTION: AsyncTask #2
E/AndroidRuntime(12219): Process: com.example.memories, PID: 12219
E/AndroidRuntime(12219): java.lang.RuntimeException: An error occurred while executing doInBackground()
E/AndroidRuntime(12219): 	at android.os.AsyncTask$3.done(AsyncTask.java:318)
E/AndroidRuntime(12219): 	at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
E/AndroidRuntime(12219): 	at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
E/AndroidRuntime(12219): 	at java.util.concurrent.FutureTask.run(FutureTask.java:242)
E/AndroidRuntime(12219): 	at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
E/AndroidRuntime(12219): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
E/AndroidRuntime(12219): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
E/AndroidRuntime(12219): 	at java.lang.Thread.run(Thread.java:760)
**E/AndroidRuntime(12219): Caused by: java.lang.RuntimeException: Methods marked with @UiThread must be executed on the main thread. Current thread: AsyncTask #2 **
E/AndroidRuntime(12219): 	at io.flutter.embedding.engine.FlutterJNI.ensureRunningOnMainThread(FlutterJNI.java:605)
E/AndroidRuntime(12219): 	at io.flutter.embedding.engine.FlutterJNI.invokePlatformMessageResponseCallback(FlutterJNI.java:556)
E/AndroidRuntime(12219): 	at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:131)
E/AndroidRuntime(12219): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success(MethodChannel.java:225)
E/AndroidRuntime(12219): 	at com.aloisdeniel.geocoder.GeocoderPlugin$1.doInBackground(GeocoderPlugin.java:79)
E/AndroidRuntime(12219): 	at com.aloisdeniel.geocoder.GeocoderPlugin$1.doInBackground(GeocoderPlugin.java:72)
E/AndroidRuntime(12219): 	at android.os.AsyncTask$2.call(AsyncTask.java:304)
E/AndroidRuntime(12219): 	at java.util.concurrent.FutureTask.run(FutureTask.java:237)
E/AndroidRuntime(12219): 	... 4 more
I/Process (12219): Sending signal. PID: 12219 SIG: 9
Lost connection to device.
Exited (sigterm)

flutter 1.7.8+hotfix.3 on stable channel | geocoder: 0.1.2

I have updated flutter 1.7.8+hotfix.3 on stable channel

Caused by: java.lang.RuntimeException: Methods marked with @UiThread must be executed on the main thread. Current thread: AsyncTask #2
E/AndroidRuntime(10984): at io.flutter.embedding.engine.FlutterJNI.ensureRunningOnMainThread(FlutterJNI.java:794)
E/AndroidRuntime(10984): at io.flutter.embedding.engine.FlutterJNI.invokePlatformMessageResponseCallback(FlutterJNI.java:727)
E/AndroidRuntime(10984): at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:140)
E/AndroidRuntime(10984): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success(MethodChannel.java:225)
E/AndroidRuntime(10984): at com.aloisdeniel.geocoder.GeocoderPlugin$1.doInBackground(GeocoderPlugin.java:79)
E/AndroidRuntime(10984): at com.aloisdeniel.geocoder.GeocoderPlugin$1.doInBackground(GeocoderPlugin.java:72)
E/AndroidRuntime(10984): at android.os.AsyncTask$2.call(AsyncTask.java:333)
E/AndroidRuntime(10984): at java.util.concurrent.FutureTask.run(FutureTask.java:266)
E/AndroidRuntime(10984): ... 4 more

How to fix this issue

Thanks

Get short_name from Google result

Hi, in my project I need to read the short_name from administrative_area_level_1, but the package read just the long_name.
Is it possible to update the package? How can I do that?
Thank you.

Find Address From Query only gets one address

Hi,
Thanks for creating the useful library.

I am currently trying to implement a method to get possible addresses from a string.

Everything works as expected but i've noticed that 99% the findAddressesFromQuery function returns one address hit only. I've tried using broad queries to test it such as searching an area with multiple similar results but had no luck reproducing the expected results.

Ex: UAE Abu Dhabi Batten Embassy (An area with 20+ embassies but I only get one hit)

Google maps search:

Screenshot 2021-02-12 at 15 16 20

function used:

String query = "UAE Abu Dhabi Batten Embassy";
var addresses = await Geocoder.local.findAddressesFromQuery(query);

I was hoping someone could give me pointers on how to get the desired results.

Thanks,

Error in IOS

I really enjoy using your package in Android.
It is the package that I really searched for!!
But I have a problem when I launch my IOS emulator

Xcode's output:

=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
Debug.xcconfig line 1: Unable to find included file "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
Debug.xcconfig line 1: Unable to find included file "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
While building module 'Flutter' imported from /Users/dojinkim/Desktop/mealme/ios/Runner/GeneratedPluginRegistrant.h:8:
In file included from :1:
In file included from /Users/dojinkim/Desktop/mealme/ios/Flutter/Flutter.framework/Headers/Flutter.h:37:
In file included from /Users/dojinkim/Desktop/mealme/ios/Flutter/Flutter.framework/Headers/FlutterAppDelegate.h:11:
/Users/dojinkim/Desktop/mealme/ios/Flutter/Flutter.framework/Headers/FlutterPlugin.h:140:58: warning: this block declaration is not a prototype [-Wstrict-prototypes]
completionHandler:(nonnull void (^)())completionHandler;
^
void
1 warning generated.
/Users/dojinkim/Desktop/mealme/ios/Runner/GeneratedPluginRegistrant.m:6:9: fatal error: 'geocoder/GeocoderPlugin.h' file not found
#import <geocoder/GeocoderPlugin.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning and 1 error generated


is there a way to solve it? Thank you by the way!

Runtime Exception in Flutter 1.8.1-pre.44

The new version of flutter throws an error in the package. Can we get the updated package, cos it is very good, just some code is casing issue.

file:///Users/alok/flutter/.pub-cache/hosted/pub.dartlang.org/geocoder-0.1.2/lib/services/d
istant_google.dart:38:56: Error: The argument type 'Utf8Decoder' can't be assigned to the
parameter type 'StreamTransformer<Uint8List, dynamic>'.
 - 'Utf8Decoder' is from 'dart:convert'.
 - 'StreamTransformer' is from 'dart:async'.
 - 'Uint8List' is from 'dart:typed_data'.
Try changing the type of the parameter, or casting the argument to
'StreamTransformer<Uint8List, dynamic>'.
    final responseBody = await response.transform(utf8.decoder).join();

Let me know whe you fix it. Thanks

Error when installing the App from Xcode to the phone

Hello,

I am using your package (^6.0.0+4), and my app works well on the IOS simulator.
When I try to instal on the phone from Xcode (12.0), I have a critical error saying:
"Library not found for -lgeocoder"

Do you have an idea of what can goes wrong?
Many thanks;
Benjamin
Capture d’écran 2020-09-23 à 17 03 01

Local Information

Hi,

Where does the local geolocations come from? Like is it built in the android device? Because the only way to get the geocodes as far as I know is to get it from google maps and other services. How does this plugin locally retrieve the geocode of different addresses?

It is NOT supporting to Null Safety

I have setup it in my project but getting error:

The library 'package:geocoder/geocoder.dart' is legacy, and should not be imported into a null safe library.
Try migrating the imported library.

Please update it's library and make it compatible with Null Safety. Thanks.

Runtime exception from flutter v 1.5

Encountering a fatal runtime exception after upgrading flutter to version 1.5, resulting in crash of app.

java.lang.RuntimeException: An error occurred while executing doInBackground()
E/AndroidRuntime(11970): 	at android.os.AsyncTask$3.done(AsyncTask.java:353)
E/AndroidRuntime(11970): 	at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
E/AndroidRuntime(11970): 	at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
E/AndroidRuntime(11970): 	at java.util.concurrent.FutureTask.run(FutureTask.java:271)
E/AndroidRuntime(11970): 	at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
E/AndroidRuntime(11970): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
E/AndroidRuntime(11970): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
E/AndroidRuntime(11970): 	at java.lang.Thread.run(Thread.java:764)
E/AndroidRuntime(11970): Caused by: java.lang.RuntimeException: Methods marked with @UiThread must be executed on the main thread. Current thread: AsyncTask #2
E/AndroidRuntime(11970): 	at io.flutter.embedding.engine.FlutterJNI.ensureRunningOnMainThread(FlutterJNI.java:605)
E/AndroidRuntime(11970): 	at io.flutter.embedding.engine.FlutterJNI.invokePlatformMessageResponseCallback(FlutterJNI.java:556)
E/AndroidRuntime(11970): 	at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:129)
E/AndroidRuntime(11970): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success(MethodChannel.java:215)
E/AndroidRuntime(11970): 	at com.aloisdeniel.geocoder.GeocoderPlugin$2.doInBackground(GeocoderPlugin.java:113)
E/AndroidRuntime(11970): 	at com.aloisdeniel.geocoder.GeocoderPlugin$2.doInBackground(GeocoderPlugin.java:106)
E/AndroidRuntime(11970): 	at android.os.AsyncTask$2.call(AsyncTask.java:333)
E/AndroidRuntime(11970): 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
E/AndroidRuntime(11970): 	... 4 more

PostalCode issue

Receiving null for postal code on Android devices. Works fine on IOS devices. The postal code shows in the address line but not when calling it on its own in Android.

Could not resolve all artifacts for configuration ':geocoder:classpath'. ANDROID / Flutter

Though the plugin works like a charm on iOS (Thanks!!), I am getting the following error on Android:
my config:
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.2.0' // new
}
distributionUrl=https://services.gradle.org/distributions/gradle-4.10.2-all.zip

Yaml dependencies:
font_awesome_flutter: ^8.2.0
carousel_pro: ^0.0.13
date_format: ^1.0.5
dots_indicator: ^0.0.4

cloud_firestore: ^0.8.2+3
google_sign_in: ^3.2.4
flutter_facebook_login: ^1.1.1
firebase_auth: ^0.6.6
firebase_storage: ^1.0.4
connectivity: ^0.3.2
intl: ^0.15.7
geolocator: ^2.1.1
geocoder: ^0.1.2
image_picker: ^0.4.10
flutter_image_compress: ^0.2.2

Launching lib/main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...
Resolving dependencies...

  • Error running Gradle:
    ProcessException: Process "xxxxx/android/gradlew" exited abnormally:
    Starting a Gradle Daemon (subsequent builds will be faster)

Configure project :app
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

Configure project :geocoder

Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring project ':geocoder'.

Could not resolve all artifacts for configuration ':geocoder:classpath'.
Could not find com.android.tools.build:gradle:2.3.3.
Searched in the following locations:
- https://jcenter.bintray.com/com/android/tools/build/gradle/2.3.3/gradle-2.3.3.pom
- https://jcenter.bintray.com/com/android/tools/build/gradle/2.3.3/gradle-2.3.3.jar
- https://maven.google.com/com/android/tools/build/gradle/2.3.3/gradle-2.3.3.pom
- https://maven.google.com/com/android/tools/build/gradle/2.3.3/gradle-2.3.3.jar
Required by:
project :geocoder

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 56s
Command: /xxxxx/android/gradlew app:properties

Finished with error: Please review your Gradle project setup in the android/ folder.

Issue while building the the flutter app with Xcode

The issue I'm facing is that I cannot archive the build to publish the application to AppStore
with this error popping up.. tried deleting all the pod files and installing them again but it didn't work but
it works perfectly fine when I run it on my iPhone using flutter run --release

Xcode Output :

Screenshot 2021-06-18 at 7 46 33 PM

Dependencies:

Screenshot 2021-06-18 at 7 48 26 PM

Flutter Doctor:

Screenshot 2021-06-18 at 8 00 58 PM

Update :

I Assume this was happening due to lack of null safety and fixed it by adding this to my YAML which supports null safety

 flutter_geocoder:
    git:
      url: https://github.com/JCKodel/flutter_geocoder.git

and also a tip never archive from Xcode it sucks for many reasons better option is to run this command from your flutter project flutter build ipa and you will get your archive file and then upload it to App store

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.