baseflow / flutter-geolocator Goto Github PK
View Code? Open in Web Editor NEWAndroid and iOS Geolocation plugin for Flutter
Home Page: https://baseflow.com/
License: MIT License
Android and iOS Geolocation plugin for Flutter
Home Page: https://baseflow.com/
License: MIT License
Would be great if we can check if the device has the gps enabled/disabled or if the user declined the location permission :)
Also see: flutter/plugins#656
i seem to be getting a number instead of a name when i use
I/flutter (27801): 8
List placemarks = await Geolocator()
.placemarkFromCoordinates(5.6098949, -0.225339);
Version: 1.x
Platform:
i keep getting a number as name of my location when i use placemarkFromCoordinates
Flutter 0.9.4
Calling _geolocator.getPositionStream().listen(...);
Followed immediately by await _geolocator.getLastKnownPosition();
Same when doing the reverse.
Crashes after allowing permission.
I/Timeline(26084): Timeline: Activity_launch_request time:146739940 intent:Intent { act=android.content.pm.action.REQUEST_PERMISSIONS pkg=com.google.android.packageinstaller (has extras) }
W/Activity(26084): Can reqeust only one set of permissions at a time
E/MethodChannel#flutter.baseflow.com/permissions/methods(26084): Failed to handle method call
E/MethodChannel#flutter.baseflow.com/permissions/methods(26084): java.lang.IllegalStateException: Reply already submitted
E/MethodChannel#flutter.baseflow.com/permissions/methods(26084): at io.flutter.view.FlutterNativeView$1.reply(FlutterNativeView.java:174)
E/MethodChannel#flutter.baseflow.com/permissions/methods(26084): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success(MethodChannel.java:194)
E/MethodChannel#flutter.baseflow.com/permissions/methods(26084): at com.baseflow.permissionhandler.PermissionHandlerPlugin.processResult(PermissionHandlerPlugin.kt:286)
E/MethodChannel#flutter.baseflow.com/permissions/methods(26084): at com.baseflow.permissionhandler.PermissionHandlerPlugin.handlePermissionsRequest(PermissionHandlerPlugin.kt:278)
E/MethodChannel#flutter.baseflow.com/permissions/methods(26084): at com.baseflow.permissionhandler.PermissionHandlerPlugin.access$handlePermissionsRequest(PermissionHandlerPlugin.kt:27)
E/MethodChannel#flutter.baseflow.com/permissions/methods(26084): at com.baseflow.permissionhandler.PermissionHandlerPlugin$Companion$registerWith$1.onRequestPermissionsResult(PermissionHandlerPlugin.kt:45)
E/MethodChannel#flutter.baseflow.com/permissions/methods(26084): at io.flutter.app.FlutterPluginRegistry.onRequestPermissionsResult(FlutterPluginRegistry.java:191)
E/MethodChannel#flutter.baseflow.com/permissions/methods(26084): at io.flutter.app.FlutterActivityDelegate.onRequestPermissionsResult(FlutterActivityDelegate.java:125)
E/MethodChannel#flutter.baseflow.com/permissions/methods(26084): at io.flutter.app.FlutterActivity.onRequestPermissionsResult(FlutterActivity.java:133)
E/MethodChannel#flutter.baseflow.com/permissions/methods(26084): at android.app.Activity.requestPermissions(Activity.java:4290)
E/MethodChannel#flutter.baseflow.com/permissions/methods(26084): at android.support.v4.app.ActivityCompat.requestPermissions(ActivityCompat.java:507)
E/MethodChannel#flutter.baseflow.com/permissions/methods(26084): at com.baseflow.permissionhandler.PermissionHandlerPlugin.requestPermissions(PermissionHandlerPlugin.kt:235)
E/MethodChannel#flutter.baseflow.com/permissions/methods(26084): at com.baseflow.permissionhandler.PermissionHandlerPlugin.onMethodCall(PermissionHandlerPlugin.kt:114)
E/MethodChannel#flutter.baseflow.com/permissions/methods(26084): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:191)
E/MethodChannel#flutter.baseflow.com/permissions/methods(26084): at io.flutter.view.FlutterNativeView.handlePlatformMessage(FlutterNativeView.java:163)
E/MethodChannel#flutter.baseflow.com/permissions/methods(26084): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#flutter.baseflow.com/permissions/methods(26084): at android.os.MessageQueue.next(MessageQueue.java:323)
E/MethodChannel#flutter.baseflow.com/permissions/methods(26084): at android.os.Looper.loop(Looper.java:142)
E/MethodChannel#flutter.baseflow.com/permissions/methods(26084): at android.app.ActivityThread.main(ActivityThread.java:6383)
E/MethodChannel#flutter.baseflow.com/permissions/methods(26084): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#flutter.baseflow.com/permissions/methods(26084): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
E/MethodChannel#flutter.baseflow.com/permissions/methods(26084): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
E/FlutterNativeView(26084): Uncaught exception in binary message listener
E/FlutterNativeView(26084): java.lang.IllegalStateException: Reply already submitted
E/FlutterNativeView(26084): at io.flutter.view.FlutterNativeView$1.reply(FlutterNativeView.java:174)
E/FlutterNativeView(26084): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:209)
E/FlutterNativeView(26084): at io.flutter.view.FlutterNativeView.handlePlatformMessage(FlutterNativeView.java:163)
E/FlutterNativeView(26084): at android.os.MessageQueue.nativePollOnce(Native Method)
E/FlutterNativeView(26084): at android.os.MessageQueue.next(MessageQueue.java:323)
E/FlutterNativeView(26084): at android.os.Looper.loop(Looper.java:142)
E/FlutterNativeView(26084): at android.app.ActivityThread.main(ActivityThread.java:6383)
E/FlutterNativeView(26084): at java.lang.reflect.Method.invoke(Native Method)
E/FlutterNativeView(26084): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
E/FlutterNativeView(26084): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
D/AndroidRuntime(26084): Shutting down VM
E/AndroidRuntime(26084): FATAL EXCEPTION: main
E/AndroidRuntime(26084): Process: app.infmarketplace, PID: 26084
E/AndroidRuntime(26084): java.lang.RuntimeException: Failure delivering result ResultInfo{who=@android:requestPermissions:, request=25, result=-1, data=Intent { act=android.content.pm.action.REQUEST_PERMISSIONS (has extras) }} to activity {app.infmarketplace/app.infmarketplace.MainActivity}: java.lang.IllegalStateException: Reply already submitted
E/AndroidRuntime(26084): at android.app.ActivityThread.deliverResults(ActivityThread.java:4221)
E/AndroidRuntime(26084): at android.app.ActivityThread.handleSendResult(ActivityThread.java:4264)
E/AndroidRuntime(26084): at android.app.ActivityThread.-wrap20(ActivityThread.java)
E/AndroidRuntime(26084): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1613)
E/AndroidRuntime(26084): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(26084): at android.os.Looper.loop(Looper.java:163)
E/AndroidRuntime(26084): at android.app.ActivityThread.main(ActivityThread.java:6383)
E/AndroidRuntime(26084): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(26084): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
E/AndroidRuntime(26084): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
E/AndroidRuntime(26084): Caused by: java.lang.IllegalStateException: Reply already submitted
E/AndroidRuntime(26084): at io.flutter.view.FlutterNativeView$1.reply(FlutterNativeView.java:174)
E/AndroidRuntime(26084): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success(MethodChannel.java:194)
E/AndroidRuntime(26084): at com.baseflow.permissionhandler.PermissionHandlerPlugin.processResult(PermissionHandlerPlugin.kt:286)
E/AndroidRuntime(26084): at com.baseflow.permissionhandler.PermissionHandlerPlugin.handlePermissionsRequest(PermissionHandlerPlugin.kt:278)
E/AndroidRuntime(26084): at com.baseflow.permissionhandler.PermissionHandlerPlugin.access$handlePermissionsRequest(PermissionHandlerPlugin.kt:27)
E/AndroidRuntime(26084): at com.baseflow.permissionhandler.PermissionHandlerPlugin$Companion$registerWith$1.onRequestPermissionsResult(PermissionHandlerPlugin.kt:45)
E/AndroidRuntime(26084): at io.flutter.app.FlutterPluginRegistry.onRequestPermissionsResult(FlutterPluginRegistry.java:191)
E/AndroidRuntime(26084): at io.flutter.app.FlutterActivityDelegate.onRequestPermissionsResult(FlutterActivityDelegate.java:125)
E/AndroidRuntime(26084): at io.flutter.app.FlutterActivity.onRequestPermissionsResult(FlutterActivity.java:133)
E/AndroidRuntime(26084): at android.app.Activity.dispatchRequestPermissionsResult(Activity.java:7277)
E/AndroidRuntime(26084): at android.app.Activity.dispatchActivityResult(Activity.java:7129)
E/AndroidRuntime(26084): at android.app.ActivityThread.deliverResults(ActivityThread.java:4217)
E/AndroidRuntime(26084): ... 9 more
I/Process (26084): Sending signal. PID: 26084 SIG: 9
Lost connection to device.
Exited (sigterm)
Including the plugin I get the following error during the compilation time.
FAILURE: Build failed with an exception.
Failed to notify project evaluation listener.
java.lang.AbstractMethodError (no error message)
Version: 2.1.0
Hello,
After upgrading to latest flutter beta (0.9.4) I cannot run my app which depends on this plugin.
Here is the error occurred when running gradle
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':google_api_availability'.
> Failed to notify project evaluation listener.
> java.lang.AbstractMethodError (no error message)
No error when running gradle
Error running gradle
Update to latest flutter beta (0.9.4), run app that depends on this plugin.
Flutter doctor output
[β] Flutter (Channel beta, v0.9.4, on Microsoft Windows [Version 10.0.17763.55], locale en-US)
β’ Flutter version 0.9.4 at D:\Devs\Flutter\flutter
β’ Framework revision f37c235c32 (2 weeks ago), 2018-09-25 17:45:40 -0400
β’ Engine revision 74625aed32
β’ Dart version 2.1.0-dev.5.0.flutter-a2eb050044
[β] Android toolchain - develop for Android devices (Android SDK 28.0.2)
β’ Android SDK at D:\AndroidSDK
β’ Android NDK location not configured (optional; useful for native profiling support)
β’ Platform android-28, build-tools 28.0.2
β’ ANDROID_HOME = D:\AndroidSDK
β’ Java binary at: D:\AndroidStudio\jre\bin\java
β’ Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
β’ All Android licenses accepted.
[β] Android Studio (version 3.1)
β’ Android Studio at D:\AndroidStudio
β’ Flutter plugin version 27.1.1
β’ Dart plugin version 173.4700
β’ Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
[β] VS Code, 64-bit edition (version 1.27.2)
β’ VS Code at C:\Program Files\Microsoft VS Code
β’ Flutter extension version 2.19.0
[β] Connected devices (1 available)
β’ Redmi 3S β’ c37ae0927d63 β’ android-arm64 β’ Android 6.0.1 (API 23)
β’ No issues found!
Version: 2.0.1
Platform:
On Android, I am able to find only the last location in memory. If I don't use Google maps or similar to find the coordinates, geolocator return a generic error "Location not found"
E/flutter (17224): PlatformException(error, locale == null, null)
E/flutter (17224): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:551)
E/flutter (17224): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:279)
E/flutter (17224):
E/flutter (17224): #2 Geolocator.placemarkFromCoordinates (package:geolocator/geolocator.dart:228)
It should be grabbing the locale from my phone if a locale isn't specified.
Using placemarkFromCoordinates without passing a locale. Working perfectly if a locale is specified.
Version: 1.6.4
Flutter: 0.7.5
Platform:
create new project
add geolocator to pubspec.yaml
flutter run
Tell us what should happen
compile and launch successfully.
Tell us what happens instead
build crashes with this massage
Launching lib\main.dart on Nexus 6P in debug mode...
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
com.android.builder.dexing.DexArchiveBuilderException: com.android.builder.dexing.DexArchiveBuilderException: Failed to process C:\dev\flutter\geo_example\build\geolocator\intermediates\intermediate-jars\debug\classes.jar
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:593)
at java.util.concurrent.ForkJoinTask.reportException(ForkJoinTask.java:677)
at java.util.concurrent.ForkJoinTask.join(ForkJoinTask.java:720)
at com.android.ide.common.internal.WaitableExecutor.waitForTasksWithQuickFail(WaitableExecutor.java:146)
at com.android.build.gradle.internal.transforms.DexArchiveBuilderTransform.transform(DexArchiveBuilderTransform.java:235)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:222)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:218)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:102)
at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:213)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$IncrementalTaskAction.doExecute(DefaultTaskClassInfoStore.java:173)
at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:134)
at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:121)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:122)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:111)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:63)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:124)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:80)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:105)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:99)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:625)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:580)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:99)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.android.builder.dexing.DexArchiveBuilderException: Failed to process C:\dev\flutter\geo_example\build\geolocator\intermediates\intermediate-jars\debug\classes.jar
at com.android.build.gradle.internal.transforms.DexArchiveBuilderTransform.launchProcessing(DexArchiveBuilderTransform.java:550)
at com.android.build.gradle.internal.transforms.DexArchiveBuilderTransform.lambda$convertToDexArchive$1(DexArchiveBuilderTransform.java:488)
at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: com.android.builder.dexing.DexArchiveBuilderException: Error while dexing com/baseflow/flutter/plugin/geolocator/tasks/LocationTask.class
The dependency contains Java 8 bytecode. Please enable desugaring by adding the following to build.gradle
android {
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
}
See https://developer.android.com/studio/write/java8-support.html for details. Alternatively, increase the minSdkVersion to 26 or above.
at com.android.builder.dexing.DxDexArchiveBuilder.getExceptionToRethrow(DxDexArchiveBuilder.java:143)
at com.android.builder.dexing.DxDexArchiveBuilder.convert(DxDexArchiveBuilder.java:89)
at com.android.build.gradle.internal.transforms.DexArchiveBuilderTransform.launchProcessing(DexArchiveBuilderTransform.java:545)
... 6 more
Caused by: com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)
at com.android.dx.cf.code.Simulator$SimVisitor.visitConstant(Simulator.java:711)
at com.android.dx.cf.code.BytecodeArray.parseInstruction(BytecodeArray.java:781)
at com.android.dx.cf.code.Simulator.simulate(Simulator.java:103)
at com.android.dx.cf.code.Ropper.processBlock(Ropper.java:790)
at com.android.dx.cf.code.Ropper.doit(Ropper.java:745)
at com.android.dx.cf.code.Ropper.convert(Ropper.java:350)
at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:309)
at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:150)
at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:102)
at com.android.builder.dexing.DxDexArchiveBuilder.dex(DxDexArchiveBuilder.java:107)
at com.android.builder.dexing.DxDexArchiveBuilder.convert(DxDexArchiveBuilder.java:86)
... 7 more
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesWithDexBuilderForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.dexing.DexArchiveBuilderException: com.android.builder.dexing.DexArchiveBuilderException: Failed to process C:\dev\flutter\geo_example\build\geolocator\intermediates\intermediate-jars\debug\classes.jar
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 34s
Gradle build failed: 1
Exited (sigterm)
$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[β] Flutter (Channel beta, v0.5.1, on Microsoft Windows [Version 10.0.17134.112], locale en-US)
[β] Android toolchain - develop for Android devices (Android SDK 28.0.1)
[β] Android Studio (version 3.1)
X Flutter plugin not installed; this adds Flutter specific functionality.
[!] VS Code, 64-bit edition (version 1.25.0)
[β] Connected devices (1 available)
! Doctor found issues in 1 category.
Version: 1.0.0
Platform:
other
i do see that the example app in this repo has modifications to build.gradle, but no reference in ReadMe file to add those modifications. or an explanation why it might be needed.
Geolocator.getPositionStream()
should return Stream without wrapping it into Feature.
This would revert breaking API change which was introduced in 1.5.0
. So breaking API after breaking API π€
I am very new to Dart but I think it is possible to make single stream without wrapping it into async
. This could be achieved by converting Feature to Stream and then chaining latestResult to new Stream with StreamTranformation.
If using RxDart class:
Stream<SomeValue> stream = someFeature.asStream().transform(SwitchMapStreamTransformer(otherStreamMapper)))
So RxDart
dependency can be introduced or just SwitchMap logic copied to project.
A function that gives us the direction we need to head to get from one place to another. An example being if I enter in coordinates/address for the Louvre museum and I'm standing at the Eiffel Tower, it will give me 266 degrees bearing. So the function itself will just return a double containing the bearing.
I think it could be included in the calculating distance function as it can give the distance and the direction which can be used in navigation in a straight line.
Here is a picture of a website that shows the general idea of what I'm looking for.
When using android_alarm_manager example plus geolocator plugin (see code below), I got following exception.
void printHelloMessage(String msg) {
Geolocator().getLastKnownPosition(LocationAccuracy.high).then((position) {
print(new HelloMessage(
new DateTime.now(),
msg,
Isolate.current.hashCode,
null,
position.toString(),
));
});
}
E/MethodChannel#flutter.baseflow.com/geolocator/methods(25437): Failed to handle method call
E/MethodChannel#flutter.baseflow.com/geolocator/methods(25437): java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Context android.content.ContextWrapper.getApplicationContext()' on a null object reference
E/MethodChannel#flutter.baseflow.com/geolocator/methods(25437): at com.baseflow.flutter.plugin.geolocator.tasks.LocationUsingLocationManagerTask.getLocationManager(LocationUsingLocationManagerTask.java:31)
E/MethodChannel#flutter.baseflow.com/geolocator/methods(25437): at com.baseflow.flutter.plugin.geolocator.tasks.LastKnownLocationUsingLocationManagerTask.startTask(LastKnownLocationUsingLocationManagerTask.java:17)
E/MethodChannel#flutter.baseflow.com/geolocator/methods(25437): at com.baseflow.flutter.plugin.geolocator.GeolocatorPlugin.onMethodCall(GeolocatorPlugin.java:54)
E/MethodChannel#flutter.baseflow.com/geolocator/methods(25437): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:191)
E/MethodChannel#flutter.baseflow.com/geolocator/methods(25437): at io.flutter.view.FlutterNativeView.handlePlatformMessage(FlutterNativeView.java:165)
E/MethodChannel#flutter.baseflow.com/geolocator/methods(25437): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#flutter.baseflow.com/geolocator/methods(25437): at android.os.MessageQueue.next(MessageQueue.java:328)
E/MethodChannel#flutter.baseflow.com/geolocator/methods(25437): at android.os.Looper.loop(Looper.java:148)
E/MethodChannel#flutter.baseflow.com/geolocator/methods(25437): at android.app.ActivityThread.main(ActivityThread.java:6251)
E/MethodChannel#flutter.baseflow.com/geolocator/methods(25437): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#flutter.baseflow.com/geolocator/methods(25437): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1075)
E/MethodChannel#flutter.baseflow.com/geolocator/methods(25437): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
No exception
flutter run
with above code snippet
Version: 1.6.2
Platform:
Doctor summary (to see all details, run flutter doctor -v):
[β] Flutter (Channel dev, v0.5.8, on Mac OS X 10.13.6 17G65, locale en-GB)
[β] Android toolchain - develop for Android devices (Android SDK 27.0.3)
[β] iOS toolchain - develop for iOS devices (Xcode 9.4.1)
[β] Android Studio (version 3.0)
[β] Connected devices (1 available)
Setup a continuous integration/ continuous deployment pipeline for the plugin. Detailed instructions can be found here.
When running app for the first time on Android
W/Activity(11227): Can reqeust only one set of permissions at a time
shows in the console log.
Using
geolocator: "^1.4.0"
Thanks.
Hi,
while testing I found that if the location service is disabled a call to geCurrentLocation just won't return until the service is switched on.
Calling checkGeolocationPermissionStatus doesn't help either because it will just return granted if the permissions are right and seems not to check id the service is available.
Cheers
Thomas
Build basic app containing a PositionStream
subscription like the example in the package's page on pub.dartlang.org.
Run the app while Location services are on and permitted.
Turn off Location (or alternatively revoke permissions) while the app is running.
Wait a few seconds/minutes
Turn Location back on (or enable permissions)
I should get some indication that the Position stopped streaming once the Location is off, and when it turns back on the Position should start streaming again on its own.
The Position stream works well and i get the Position updates as expected, when i turn Location off the last Position will stay until i manually request a new one using the getPosition
method, only then i will get a null
Position.
That way if someone had a working location but lost it for any reason there's no way to notify him, and the last position will stay "forever".
In the GIF below you can see this behavior, i'm iterating a GPX file and when i turn off Location there is no indication for that anywhere, until i press the "Refresh" button that has the following code:
void initPlatformState() async {
Position position;
try {
position = await _geolocator.getPosition(LocationAccuracy.high);
} on PlatformException catch (e) {
print(e.message);
position = null;
}
if (!mounted) return;
setState(() {
_position = position;
if (_position == null) {
print('NO LOCATION!');
}
});
}
Is there something i'm doing wrong or that's a flutter's framework constraint?
Version: 1.2.1
Platform:
getCurrentPosition only works when GPS ist set manually to energysafing/highAccuracy Mode on Android. If the Location Mode is set To GPS only, getCurrentPosition doesnt respond and the Code Stops waiting for a signal without any reply
working with GPS data Mode "Only Smartphone"
You Will never get the Response print "print(position)" in this example, if gps isnt set to energysaving or high accuracy manually
Geolocator geolocator = Geolocator()..forceAndroidLocationManager = true; GeolocationStatus geolocationStatus = await Geolocator().checkGeolocationPermissionStatus(); print(geolocationStatus); Position position = await Geolocator().getCurrentPosition(desiredAccuracy: LocationAccuracy.lowest); print(position);
Version: 1.x
Platform:
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
Just wondered why both of these permissions are requested. I think you only need to request Fine.
Unable to find source java class: '/home/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/geolocator-1.3.0/android/src/main/java/com/baseflow/flutter/plugin/geolocator/tasks/OneTimeLocationTask.java' because it does not belong to any of the source dirs: '[/home/hitanshu/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/geolocator-1.4.0/android/src/main/java, /home/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/geolocator-1.4.0/android/src/debug/java, /home/AndroidStudioProjects/onlinecitydemo/build/geolocator/generated/source/r/debug, /home/AndroidStudioProjects/onlinecitydemo/build/geolocator/generated/source/buildConfig/debug, /home/AndroidStudioProjects/onlinecitydemo/build/geolocator/generated/source/aidl/debug, /homeAndroidStudioProjects/onlinecitydemo/build/geolocator/generated/source/rs/debug]'
error after update
FAILURE: Build failed with an exception.
From Flutter Project
What went wrong:
Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Could not resolve com.google.android.gms:play-services-location:15.+.
Required by:
project :app > project :geolocator
project :app > project :google_api_availability
Tools > Flutter > Open Android module in Android Studio
Unable to resolve dependency for ':geolocator@debug/compileClasspath': Could not resolve com.google.android.gms:play-services-basement:[15.0.1,16.0.0).
Open File
Show Details
Unable to resolve dependency for ':geolocator@debug/compileClasspath': Could not resolve com.google.android.gms:play-services-places-placereport:[15.0.1,16.0.0).
Open File
Show Details
Unable to resolve dependency for ':geolocator@debug/compileClasspath': Could not resolve com.google.android.gms:play-services-tasks:[15.0.1,16.0.0).
Open File
Show Details
Unable to resolve dependency for ':geolocator@debugAndroidTest/compileClasspath': Could not resolve com.google.android.gms:play-services-base:[15.0.1,16.0.0).
Open File
Show Details
Unable to resolve dependency for ':geolocator@debugAndroidTest/compileClasspath': Could not resolve com.google.android.gms:play-services-basement:[15.0.1,16.0.0).
Open File
Show Details
Unable to resolve dependency for ':geolocator@debugAndroidTest/compileClasspath': Could not resolve com.google.android.gms:play-services-places-placereport:[15.0.1,16.0.0).
Open File
Show Details
Unable to resolve dependency for ':geolocator@debugAndroidTest/compileClasspath': Could not resolve com.google.android.gms:play-services-tasks:[15.0.1,16.0.0).
Open File
Show Details
Unable to resolve dependency for ':geolocator@debugUnitTest/compileClasspath': Could not resolve com.google.android.gms:play-services-base:[15.0.1,16.0.0).
Open File
Show Details
Unable to resolve dependency for ':geolocator@debugUnitTest/compileClasspath': Could not resolve com.google.android.gms:play-services-basement:[15.0.1,16.0.0).
Open File
Show Details
Unable to resolve dependency for ':geolocator@debugUnitTest/compileClasspath': Could not resolve com.google.android.gms:play-services-places-placereport:[15.0.1,16.0.0).
Open File
Show Details
Unable to resolve dependency for ':geolocator@debugUnitTest/compileClasspath': Could not resolve com.google.android.gms:play-services-tasks:[15.0.1,16.0.0).
Open File
Show Details
Unable to resolve dependency for ':geolocator@release/compileClasspath': Could not resolve com.google.android.gms:play-services-base:[15.0.1,16.0.0).
Open File
Show Details
Unable to resolve dependency for ':geolocator@release/compileClasspath': Could not resolve com.google.android.gms:play-services-basement:[15.0.1,16.0.0).
Open File
Show Details
Unable to resolve dependency for ':geolocator@release/compileClasspath': Could not resolve com.google.android.gms:play-services-places-placereport:[15.0.1,16.0.0).
Open File
Show Details
Unable to resolve dependency for ':geolocator@release/compileClasspath': Could not resolve com.google.android.gms:play-services-tasks:[15.0.1,16.0.0).
Open File
Show Details
Unable to resolve dependency for ':geolocator@releaseUnitTest/compileClasspath': Could not resolve com.google.android.gms:play-services-base:[15.0.1,16.0.0).
Open File
Show Details
Unable to resolve dependency for ':geolocator@releaseUnitTest/compileClasspath': Could not resolve com.google.android.gms:play-services-basement:[15.0.1,16.0.0).
Open File
Show Details
Unable to resolve dependency for ':geolocator@releaseUnitTest/compileClasspath': Could not resolve com.google.android.gms:play-services-places-placereport:[15.0.1,16.0.0).
Open File
Show Details
Unable to resolve dependency for ':geolocator@releaseUnitTest/compileClasspath': Could not resolve com.google.android.gms:play-services-tasks:[15.0.1,16.0.0).
Open File
Show Details
Unable to resolve dependency for ':google_api_availability@debug/compileClasspath': Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jre7:1.2.71.
Open File
Show Details
Unable to resolve dependency for ':google_api_availability@debug/compileClasspath': Could not resolve com.google.android.gms:play-services-base:[15.0.1,16.0.0).
Open File
Show Details
Unable to resolve dependency for ':google_api_availability@debug/compileClasspath': Could not resolve com.google.android.gms:play-services-basement:[15.0.1,16.0.0).
Open File
Show Details
Unable to resolve dependency for ':google_api_availability@debug/compileClasspath': Could not resolve com.google.android.gms:play-services-places-placereport:[15.0.1,16.0.0).
Open File
Show Details
Unable to resolve dependency for ':google_api_availability@debug/compileClasspath': Could not resolve com.google.android.gms:play-services-tasks:[15.0.1,16.0.0).
Open File
Show Details
Unable to resolve dependency for ':google_api_availability@debugAndroidTest/compileClasspath': Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jre7:1.2.71.
Open File
Show Details
Unable to resolve dependency for ':google_api_availability@debugAndroidTest/compileClasspath': Could not resolve com.google.android.gms:play-services-base:[15.0.1,16.0.0).
Open File
Show Details
Unable to resolve dependency for ':google_api_availability@debugAndroidTest/compileClasspath': Could not resolve com.google.android.gms:play-services-basement:[15.0.1,16.0.0).
Open File
Show Details
Unable to resolve dependency for ':google_api_availability@debugAndroidTest/compileClasspath': Could not resolve com.google.android.gms:play-services-places-placereport:[15.0.1,16.0.0).
Open File
Show Details
Unable to resolve dependency for ':google_api_availability@debugAndroidTest/compileClasspath': Could not resolve com.google.android.gms:play-services-tasks:[15.0.1,16.0.0).
Open File
Show Details
Unable to resolve dependency for ':google_api_availability@debugUnitTest/compileClasspath': Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jre7:1.2.71.
Open File
Show Details
Unable to resolve dependency for ':google_api_availability@debugUnitTest/compileClasspath': Could not resolve com.google.android.gms:play-services-base:[15.0.1,16.0.0).
Open File
Show Details
Unable to resolve dependency for ':google_api_availability@debugUnitTest/compileClasspath': Could not resolve com.google.android.gms:play-services-basement:[15.0.1,16.0.0).
Open File
Show Details
Unable to resolve dependency for ':google_api_availability@debugUnitTest/compileClasspath': Could not resolve com.google.android.gms:play-services-places-placereport:[15.0.1,16.0.0).
Open File
Show Details
Unable to resolve dependency for ':google_api_availability@debugUnitTest/compileClasspath': Could not resolve com.google.android.gms:play-services-tasks:[15.0.1,16.0.0).
Open File
Show Details
Unable to resolve dependency for ':google_api_availability@release/compileClasspath': Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jre7:1.2.71.
Open File
Show Details
Unable to resolve dependency for ':google_api_availability@release/compileClasspath': Could not resolve com.google.android.gms:play-services-base:[15.0.1,16.0.0).
Open File
Show Details
Unable to resolve dependency for ':google_api_availability@release/compileClasspath': Could not resolve com.google.android.gms:play-services-basement:[15.0.1,16.0.0).
Open File
Show Details
Unable to resolve dependency for ':google_api_availability@release/compileClasspath': Could not resolve com.google.android.gms:play-services-places-placereport:[15.0.1,16.0.0).
Open File
dependencies:
geolocator: ^2.0.1
flutter doctor -v
[β] Flutter (Channel beta, v0.8.2, on Mac OS X 10.14 18A391, locale en-ID)
β’ Flutter version 0.8.2 at /Users/Maulana/Development/flutter
β’ Framework revision 5ab9e70727 (4 weeks ago), 2018-09-07 12:33:05 -0700
β’ Engine revision 58a1894a1c
β’ Dart version 2.1.0-dev.3.1.flutter-760a9690c2
[β] Android toolchain - develop for Android devices (Android SDK 28.0.3)
β’ Android SDK at /Users/Maulana/Development/AndroidSDK
β’ Android NDK location not configured (optional; useful for native profiling support)
β’ Platform android-28, build-tools 28.0.3
β’ Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
β’ Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
β’ All Android licenses accepted.
[β] iOS toolchain - develop for iOS devices (Xcode 10.0)
β’ Xcode at /Applications/Xcode.app/Contents/Developer
β’ Xcode 10.0, Build version 10A255
β’ ios-deploy 2.0.0
β’ CocoaPods version 1.5.3
[β] Android Studio (version 3.2)
β’ Android Studio at /Applications/Android Studio.app/Contents
β’ Flutter plugin version 29.0.2
β’ Dart plugin version 181.5616
β’ Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
[β] VS Code (version 1.27.2)
β’ VS Code at /Applications/Visual Studio Code.app/Contents
β’ Flutter extension version 2.18.0
[β] Connected devices (1 available)
β’ Android SDK built for x86 β’ emulator-5554 β’ android-x86 β’ Android 8.1.0 (API 27) (emulator)
β’ No issues found!
Version: 2.0.1
Platform:
Could you add support for
kCLLocationAccuracyBestForNavigation in iOS?
Thanks
Can the plugin be changed so that the location sharing request occurs when the user confirms location sharing through a button tap, for example, rather than requesting location sharing as soon as the app starts?
Basic Permission requesting - makes it more likely that the user will accept location sharing since they are asked before the alert appears.
Usually a button or some other interaction will cause an alert to appear with location sharing requested. Allow the user to accept location sharing with the tap of a button.
Android - Appears slow to report first location, compared to a native Android app. It does not appear to use the Android fused location provider? I have not tested getlastknown I only using get current and also registering for updates.
On Apple a location is return instantly.
My native Java apps using the fused location provider will generally return a location (of some sort) almost instantly.
Followed example code. Seems particularly slow if no wifi/cell connection available and it has to rely on GPS. Have had some reports of no location being returned at all
Version:
Latest version of geoLocator
Platform:
Please add a function to check if location service is on or off on device.
Android :
public static boolean isLocationEnabled(Context context) {
int locationMode = 0;
String locationProviders;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){
try {
locationMode = Settings.Secure.getInt(context.getContentResolver(), Settings.Secure.LOCATION_MODE);
} catch (SettingNotFoundException e) {
e.printStackTrace();
return false;
}
return locationMode != Settings.Secure.LOCATION_MODE_OFF;
}else{
locationProviders = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED);
return !TextUtils.isEmpty(locationProviders);
}
}
Refference : https://stackoverflow.com/a/22980843
iOS:
Hi guys,
I'm sorry if this is not the place to put my question, feel free to delete it.
I want to get a city name with your plugin.
My issue is that I need an ID for a city but if my phone language settings are in english the placemark.first.locality
give me Venice
, when they are in italian I get Venezia
.
Do you have any suggestion for solving this?
Thank you for your work.
Add support to translate a given address into a list of coΓΆrdinates
The current version of the plug-in supports using the Location Services from Google Play Services to acquire location updates. When the Google Play Services are not available the plug-in automatically falls back to the LocationManager
.
In certain situations it is possible for the user of the device to take certain steps that would make the Google Play Services available and thus improving the quality of the location updates. To allow app developers to inform the user of the device it would be useful if the developer can request the current status of the Google Play Services.
See also the "Ensure Devices Have the Google Play services APK" of the Set Up Google Play Service
Would love to see the DateTimestamp included in the Position object to assist with determining age of record.
GPS co-ordinates generally includes this value, and hence we believe it is relevant and useful.
Hopefully it is a matter of including it when the 'position' object is created as part of the call to the device to generate the 'current location'
Nice plugin btw ;)
Thanks for this plugin, works great!
To save battery live it might be a good idea to be able not only to specify an update rate by distance but also by time.
I installed this plug-in yesterday and tried the getCurrentPosition and getLastKnownPosition features. It worked just as expected. Then I did other non-related changes in my project (updated an asset) and when I tried to build again I got this error.
Execution failed for task ':geolocator:compileDebugJavaWithJavac'.
Unable to find source java class: '/Users/lauraroige/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/geolocator-1.5.0/android/src/main/java/com/baseflow/flutter/plugin/geolocator/tasks/CurrentLocationTask.java' because it does not belong to any of the source dirs: '[/Users/lauraroige/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/geolocator-1.6.0/android/src/main/java, /Users/lauraroige/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/geolocator-1.6.0/android/src/debug/java, /Users/lauraroige/ecolocal_app/ecolocal_app/build/geolocator/generated/source/r/debug, /Users/lauraroige/ecolocal_app/ecolocal_app/build/geolocator/generated/source/buildConfig/debug, /Users/lauraroige/ecolocal_app/ecolocal_app/build/geolocator/generated/source/aidl/debug, /Users/lauraroige/ecolocal_app/ecolocal_app/build/geolocator/generated/source/rs/debug]'
I tried changing the version of the plug-in, but when I delete the directory and install it again it always installs the 1.6.0 version regardless of what I try to install (tried with version 1.4.0 as the error mentions versions 1.5.0 and 1.6.0).
The project builds correctly if I eliminate the geolocator import from the pubspec. The build fails as soon as I add the import (even if I don't use it in the project code).
Build correctly.
Add the plug-in to a project.
Version: 1.6.0
Platform:
in geolocator.dart ln 61:
return Position?._fromMap(position);
Throws an exception when position is null:
NoSuchMethodError: The method 'containsKey' was called on null.
It should instead simply return null if position is null as the documentation specifies.
Is there any way I can get the 2 digits country ISO code? like "AR", "US", etc. from this plugin once it geolocates the device?
Thank you.
On iPhone 1.7.0 Fails to register location permissions. Android works OK.
Permissions package issue?
Successfully register location permissions on iOS 10 and 11
Fails to register location permissions, then
on iOS 10 crashes out.
on iOS 11 fails to register location permission, app runs.
geolocator: "1.6.5"
Works
geolocator: "1.7.0"
Fails
In iOS settings the app has not registered for location permission.
Version: 1.7.0
Platform:
Currently the interval on which the location will be read is hard coded. It would be nice if we can update this so that the developer can change the interval at run-time.
The use-case here would be to allow developers to dial back or increase the frequency depending on the state off the App (e.g. background vs. foreground).
Simply add the onesignal package to geolocator the sample project, configure correctly the two packages, and run on a device and BOOM the trick happens
App crashes...
Run the app
Add the latest onesignal package (oficial or community) from pub packages and run the app, him will crash....
dont need...
My pubspec
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
onesignal: ^1.0.2
geolocator: ^2.0.1
Version: ^2.0.1
Platform:
Add more UI to the sample app and include screenshots in the readme.
running flutter build ios --release :
=== BUILD TARGET firebase_messaging OF PROJECT Pods WITH CONFIGURATION Release ===
/Users/****/development/flutter/.pub-cache/hosted/pub.dartlang.org/geolocator-0.0.1/ios/Classes/GeolocatorPlugin.m:2:9: fatal error: 'geolocator/geolocator-Swift.h' file not found
#import <geolocator/geolocator-Swift.h>
My doctor output:
Doctor summary (to see all details, run flutter doctor -v):
[β] Flutter (Channel dev, v0.5.5, on Mac OS X 10.13.3 17D102, locale pt-PT)
[β] Android toolchain - develop for Android devices
β Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.io/setup/#android-setup for detailed instructions).
If Android SDK has been installed to a custom location, set $ANDROID_HOME to that location.
[β] iOS toolchain - develop for iOS devices (Xcode 9.2)
[β] Android Studio (not installed)
[!] VS Code (version 1.14.2)
[!] Connected devices
! No devices available
First deny returns exception as expected
PlatformException(PERMISSION_DENIED, Access to location data denied, null)
Second time denying, the app crashes
D/AndroidRuntime( 3792): Shutting down VM
E/AndroidRuntime( 3792): FATAL EXCEPTION: main
E/AndroidRuntime( 3792): Process: app.infmarketplace, PID: 3792
E/AndroidRuntime( 3792): java.lang.RuntimeException: Failure delivering result ResultInfo{who=@android:requestPermissions:, request=34, result=-1, data=Intent { act=android.content.pm.action.REQUEST_PERMISSIONS (has extras) }} to activity {app.infmarketplace/app.infmarketplace.MainActivity}: java.lang.IllegalStateException: Reply already submitted
E/AndroidRuntime( 3792): at android.app.ActivityThread.deliverResults(ActivityThread.java:4324)
E/AndroidRuntime( 3792): at android.app.ActivityThread.handleSendResult(ActivityThread.java:4367)
E/AndroidRuntime( 3792): at android.app.ActivityThread.-wrap19(Unknown Source:0)
E/AndroidRuntime( 3792): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1649)
E/AndroidRuntime( 3792): at android.os.Handler.dispatchMessage(Handler.java:105)
E/AndroidRuntime( 3792): at android.os.Looper.loop(Looper.java:164)
E/AndroidRuntime( 3792): at android.app.ActivityThread.main(ActivityThread.java:6541)
E/AndroidRuntime( 3792): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 3792): at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
E/AndroidRuntime( 3792): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
E/AndroidRuntime( 3792): Caused by: java.lang.IllegalStateException: Reply already submitted
E/AndroidRuntime( 3792): at io.flutter.view.FlutterNativeView$1.reply(FlutterNativeView.java:162)
E/AndroidRuntime( 3792): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.error(MethodChannel.java:199)
E/AndroidRuntime( 3792): at com.baseflow.flutter.plugin.geolocator.data.Result.error(Result.java:30)
E/AndroidRuntime( 3792): at com.baseflow.flutter.plugin.geolocator.tasks.LastKnownLocationTask.handleError(LastKnownLocationTask.java:40)
E/AndroidRuntime( 3792): at com.baseflow.flutter.plugin.geolocator.tasks.LocationTask$1.onRequestPermissionsResult(LocationTask.java:118)
E/AndroidRuntime( 3792): at io.flutter.app.FlutterPluginRegistry.onRequestPermissionsResult(FlutterPluginRegistry.java:175)
E/AndroidRuntime( 3792): at io.flutter.app.FlutterActivityDelegate.onRequestPermissionsResult(FlutterActivityDelegate.java:132)
E/AndroidRuntime( 3792): at io.flutter.app.FlutterActivity.onRequestPermissionsResult(FlutterActivity.java:134)
E/AndroidRuntime( 3792): at android.app.Activity.dispatchRequestPermissionsResult(Activity.java:7388)
E/AndroidRuntime( 3792): at android.app.Activity.dispatchActivityResult(Activity.java:7239)
E/AndroidRuntime( 3792): at android.app.ActivityThread.deliverResults(ActivityThread.java:4320)
E/AndroidRuntime( 3792): ... 9 more
Return the exception again
Request last known location as follows
try {
Position position = await Geolocator().getLastKnownPosition(LocationAccuracy.medium);
print(position); // May be null
} catch (ex) {
print(ex); // Or fail to give permissions
// PlatformException(PERMISSION_DENIED, Access to location data denied, null)
}
Version: 1.4.0
Platform:
Great work! Good to see we can set desiredAccuracy. Please can we have an option to set DistanceFilter to "throttle" updates.
Thanks.
Nicolas
Can you add an option to LocationOptions for force LocationManager instead of FusedLocation?
Can't compile geolocator plugin (due to invalid GoogleApiAvailabilityPlugin compilation) since last upgrade to flutter 0.9.6, but works perfectly before (0.8.5):
.pub-cache/hosted/pub.dartlang.org/google_api_availability-1.0.2/android/src/main/kotlin/com/baseflow/googleapiavailability/GoogleApiAvailabilityPlugin.kt: (29, 48): Type inference failed. Expected type mismatch: inferred type is Boolean? but Boolean was expected
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':google_api_availability:compileDebugKotlin'.
> Compilation error. See log for more details
Thanks for any input !
Version: 1.x
Platform:
Cannot build the app for iOS with the '!use_framework' commented out. This causes an issue when using with other libraries (map_view, firebase_*)
This should be build as to not require the '!use_framework' option on podfile.
Try building with 'map_view' and 'geolocator' both present in the pubspec.yaml
Version: 1.x
Platform:
I have found a couple of issues in the documentation/README.md, not quite sure if I'm right, hence creating an issue and not a PR.
import 'package:geolocator/geolocator.dart';
Position position = await Geolocator().getCurrentPosition(desiredAccuracy: LocationAccuracy.high);
desiredAccuracy seems to be a positional argument and not a named argument. The line should be:
Position position = await Geolocator().getCurrentPosition(LocationAccuracy.high);
import 'package:geolocator/geolocator.dart';
Placemark placemark = await Geolocator().placemarkFromAddress("Gronausestraat 710, Enschede");
Here placemarkFromAddress()
returns a List and not a Placemark
. Should be:
List<Placemark> placemark = await Geolocator().placemarkFromAddress("Gronausestraat 710, Enschede");
There can be a few more issues, but I didn't need more info than this, so I didn't try.
Unable to find source java class: '/home/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/geolocator-1.3.0/android/src/main/java/com/baseflow/flutter/plugin/geolocator/tasks/OneTimeLocationTask.java' because it does not belong to any of the source dirs: '[/home/hitanshu/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/geolocator-1.4.0/android/src/main/java, /home/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/geolocator-1.4.0/android/src/debug/java, /home/AndroidStudioProjects/onlinecitydemo/build/geolocator/generated/source/r/debug, /home/AndroidStudioProjects/onlinecitydemo/build/geolocator/generated/source/buildConfig/debug, /home/AndroidStudioProjects/onlinecitydemo/build/geolocator/generated/source/aidl/debug, /homeAndroidStudioProjects/onlinecitydemo/build/geolocator/generated/source/rs/debug]'
error after update
I am using the following code in which the statement
Position position = await Geolocator().getCurrentPosition(desiredAccuracy: LocationAccuracy.low);
just hangs and does not reach the next statement
This is what I am doing
Future<Position> getLocation() async
{
Geolocator geolocator = Geolocator()..forceAndroidLocationManager = true;
GeolocationStatus geolocationStatus = await geolocator.checkGeolocationPermissionStatus();
Position position = await Geolocator().getCurrentPosition(desiredAccuracy: LocationAccuracy.low);
return position;
}
Here are the details of my env.
$ flutter doctor -v
[β] Flutter (Channel beta, v0.6.0, on Mac OS X 10.13.6 17G65, locale en-US)
β’ Flutter version 0.6.0 at /Users/adam/Flutter/flutter
β’ Framework revision 9299c02cf7 (6 weeks ago), 2018-08-16 00:35:12 +0200
β’ Engine revision e3687f70c7
β’ Dart version 2.1.0-dev.0.0.flutter-be6309690f
[β] Android toolchain - develop for Android devices (Android SDK 28.0.0)
β’ Android SDK at /Users/adam/Library/Android/sdk
β’ Android NDK location not configured (optional; useful for native profiling support)
β’ Platform android-28, build-tools 28.0.0
β’ ANDROID_HOME = /Users/adam/Library/Android/sdk
β’ Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
β’ Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
β’ All Android licenses accepted.
[β] iOS toolchain - develop for iOS devices (Xcode 9.4.1)
β’ Xcode at /Applications/Xcode.app/Contents/Developer
β’ Xcode 9.4.1, Build version 9F2000
β’ ios-deploy 1.9.2
β’ CocoaPods version 1.5.0
[β] Android Studio (version 3.1)
β’ Android Studio at /Applications/Android Studio.app/Contents
β Flutter plugin not installed; this adds Flutter specific functionality.
β Dart plugin not installed; this adds Dart specific functionality.
β’ Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
[β] IntelliJ IDEA Ultimate Edition (version 2018.1.1)
β’ IntelliJ at /Applications/IntelliJ IDEA.app
β’ Flutter plugin version 24.0.2
β’ Dart plugin version 181.4445.29
[β] Connected devices (1 available)
β’ Android SDK built for x86 β’ emulator-5554 β’ android-x86 β’ Android 7.1.1 (API 25) (emulator)
β’ No issues found!
Any suggestions on why the statement just hangs ?
When using placemarkFromCoordinates, I get the error type 'List<dynamic>' is not a subtype of type 'Future<dynamic>'
on line 192 in geolocator.dart.
Changing Future<dynamic> placemarks = await _methodChannel.invokeMethod( 'placemarkFromCoordinates', <String, double>{"latitude": latitude, "longitude": longitude});
to
List<dynamic> placemarks = await _methodChannel.invokeMethod( 'placemarkFromCoordinates', <String, double>{"latitude": latitude, "longitude": longitude});
fixes the issue.
Flutter 0.7.0
Version: 1.6.2
Platform:
Nice extra feature to have would be the option to calculate the distance between two points.
hi, i'm using this plugin but afther add the dependence in pubspec.yaml
geolocator: "^1.7.0"
i'm importing into a dart file ->
import 'package:geolocation/geolocation.dart';
i did flutter packages get, but in my dart analysis i get.
error: Target of URI doesn't exist: 'package:geolocation/geolocation.dart'. (uri_does_not_exist at [xxxxx] lib\screens\Home\tab_location.dart:8)
flutter doctor -v
[β] Flutter (Channel dev, v0.8.4, on Microsoft Windows [VersiΓΒ³n 10.0.14393], locale es-US)
β’ Flutter version 0.8.4 at c:\flutter
β’ Framework revision 7f7a731da0 (2 days ago), 2018-09-14 13:11:32 -0400
β’ Engine revision 7a9b430d74
β’ Dart version 2.1.0-dev.4.0.flutter-c28db2d6e1
[!] Android toolchain - develop for Android devices (Android SDK 27.0.3)
β’ Android SDK at C:\Users\Alex\AppData\Local\Android\sdk
β’ Android NDK location not configured (optional; useful for native profiling support)
β’ Platform android-27, build-tools 27.0.3
β’ Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
β’ Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
X Android license status unknown.
[β] Android Studio (version 3.1)
β’ Android Studio at C:\Program Files\Android\Android Studio
β’ Flutter plugin version 28.0.1
β’ Dart plugin version 173.4700
β’ Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
[!] Connected devices
! No devices available
! Doctor found issues in 2 categories.
how i do to solve this error?
thank you
When compiling for iOS release
Clean build.
The use of Swift 3 @objc inference in Swift 4 mode is deprecated. Please address deprecated @objc inference warnings, test your code with βUse of deprecated Swift 3 @objc inferenceβ logging enabled, and then disable inference by changing the "Swift 3 @objc Inference" build setting to "Default" for the "Runner" target.
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.