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

is it working with Wear OS ?

Open weissloic opened this issue 2 years ago • 5 comments

When I try to get my location on my watch, I always get this error message : "The location service on the device is disabled.", however it's enabled.

Thx

weissloic avatar Jul 14 '21 13:07 weissloic

Are you sure that you set the correct permissions in the manifest file for wear os?

if you forget it just add this line to the android manifest file

<uses-permission android:name="android.hardware.location" />

AlirezaEiji191379 avatar Jul 15 '21 14:07 AlirezaEiji191379

Yes, it's already done, i've tested the same code on my Oneplus 6t and it works...

weissloic avatar Jul 15 '21 15:07 weissloic

Hi @weissloic,

This is hard to say, I personally don't have access to a WearOS device and therefore haven't tested. The plugin is developed (and tested) for Android phone/ tablets, iOS phones and tablets and the web. I have not done anything specific to make sure WearOS is also supported.

If you could help out and maybe debug on you WearOS device and give feedback on where things might go wrong, I am more then willing to make changes to make sure WearOS is also supported correctly.

mvanbeusekom avatar Jul 19 '21 08:07 mvanbeusekom

Can confirm, speed api works perfectly well on android phone but throws an error about the service being disabled on any wearOS device.

Any updates or plans on this?

masus04 avatar Aug 11 '22 17:08 masus04

I would be motivated to add wearOS support to the android plugin, if you can point me in the right direction.

masus04 avatar Aug 14 '22 11:08 masus04

Hi @mvanbeusekom

I just realized now that you offered to help implement it :)

I only develop on Android Studio, using the provided WearOS emulator. It is quite simple to use and the error seems to be identical to the one @weissloic describes.

I can post the stacktrace I receive below:

D/FlutterGeolocator( 6377): Attaching Geolocator to activity
D/FlutterGeolocator( 6377): Creating service.
D/FlutterGeolocator( 6377): Binding to location service.
D/FlutterGeolocator( 6377): Geolocator foreground service connected
D/FlutterGeolocator( 6377): Initializing Geolocator services
D/FlutterGeolocator( 6377): Flutter engine connected. Connected engine count 1
...
E/FlutterGeolocator( 6377): Geolocator position updates started
...
I/flutter ( 6377): The location service on the device is disabled.
I/flutter ( 6377): #0      GeolocatorAndroid.getPositionStream.<anonymous closure> (package:geolocator_android/src/geolocator_android.dart:187:9)
I/flutter ( 6377): (elided 26 frames from dart:async)

There's not really anything useful in there as far as I can tell. I assume there's a different API that must be used for wearOS compared to regular android?

Does this help? Otherwise let me know what I can do in order to help.

masus04 avatar Nov 17 '22 00:11 masus04

So, no updates?

talhazengin avatar Apr 12 '23 21:04 talhazengin

so you cannot get the Wear OS device's location in flutter??? because the location library is outdated too

E/AndroidRuntime(23228): com.google.android.gms.tasks.RuntimeExecutionException: com.google.android.gms.common.api.ApiException: 10: Not implemented on this platform.
E/AndroidRuntime(23228): 	at com.google.android.gms.tasks.zzw.getResult(com.google.android.gms:play-services-tasks@@18.0.2:3)
E/AndroidRuntime(23228): 	at com.baseflow.geolocator.location.FusedLocationClient.lambda$isLocationServiceEnabled$0(FusedLocationClient.java:142)
E/AndroidRuntime(23228): 	at com.baseflow.geolocator.location.FusedLocationClient$$ExternalSyntheticLambda4.onComplete(Unknown Source:2)
E/AndroidRuntime(23228): 	at com.google.android.gms.tasks.zzi.run(com.google.android.gms:play-services-tasks@@18.0.2:1)
E/AndroidRuntime(23228): 	at android.os.Handler.handleCallback(Handler.java:938)
E/AndroidRuntime(23228): 	at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(23228): 	at android.os.Looper.loop(Looper.java:246)
E/AndroidRuntime(23228): 	at android.app.ActivityThread.main(ActivityThread.java:7690)
E/AndroidRuntime(23228): 	at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(23228): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:593)
E/AndroidRuntime(23228): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:995)
E/AndroidRuntime(23228): Caused by: com.google.android.gms.common.api.ApiException: 10: Not implemented on this platform.
E/AndroidRuntime(23228): 	at com.google.android.gms.common.internal.ApiExceptionUtil.fromStatus(com.google.android.gms:play-services-base@@18.1.0:3)
E/AndroidRuntime(23228): 	at com.google.android.gms.common.api.internal.TaskUtil.setResultOrApiException(com.google.android.gms:play-services-base@@18.1.0:4)
E/AndroidRuntime(23228): 	at com.google.android.gms.internal.location.zzcq.zzb(com.google.android.gms:play-services-location@@21.0.1:2)
E/AndroidRuntime(23228): 	at com.google.android.gms.internal.location.zzr.zza(com.google.android.gms:play-services-location@@21.0.1:3)
E/AndroidRuntime(23228): 	at com.google.android.gms.internal.location.zzb.onTransact(com.google.android.gms:play-services-location@@21.0.1:3)
E/AndroidRuntime(23228): 	at android.os.Binder.execTransactInternal(Binder.java:1159)
E/AndroidRuntime(23228): 	at android.os.Binder.execTransact(Binder.java:1123)

Deme94 avatar May 25 '23 15:05 Deme94

Closing this issue as discussion pointed out that WearOS is indeed not supported at this time.

Please refer to #1197 for tracking WearOS support.

JeroenWeener avatar Jun 13 '23 15:06 JeroenWeener