Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On Android in release mode, getLocation fails intermittently with PlatformException (null object reference) #885

Open
dixiak opened this issue Aug 12, 2023 · 0 comments

Comments

@dixiak
Copy link

dixiak commented Aug 12, 2023

Works fine in Debug mode and about 50% of the time in Release.
The rest of the time it just throws an exception.

Tested on:

  • Android, API Level 33 real device
  • Android, API Level 30 real device
  • Emulator, API Level 33 - Does not repro!

Other plugins:
grpc: ^3.1.0
connectivity_plus: ^4.0.2
location: ^5.0.3

D/FlutterLocationService(11083): Creating service.
D/FlutterLocationService(11083): Binding to location service.
E/flutter (11083): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(error, Attempt to write to field 't0.j$d com.lyokone.location.a.p' on a null object reference, null, java.lang.NullPointerException: Attempt to write to field 't0.j$d com.lyokone.location.a.p' on a null object reference
E/flutter (11083): at com.lyokone.location.c.f(Unknown Source:2)
E/flutter (11083): at com.lyokone.location.c.a(Unknown Source:149)
E/flutter (11083): at t0.j$a.a(Unknown Source:17)
E/flutter (11083): at h0.c.j(Unknown Source:18)
E/flutter (11083): at h0.c.k(Unknown Source:40)
E/flutter (11083): at h0.c.g(Unknown Source:0)
E/flutter (11083): at h0.b.run(Unknown Source:12)
E/flutter (11083): at android.os.Handler.handleCallback(Handler.java:938)
E/flutter (11083): at android.os.Handler.dispatchMessage(Handler.java:99)
E/flutter (11083): at android.os.Looper.loop(Looper.java:246)
E/flutter (11083): at android.app.ActivityThread.main(ActivityThread.java:8653)
E/flutter (11083): at java.lang.reflect.Method.invoke(Native Method)
E/flutter (11083): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
E/flutter (11083): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
E/flutter (11083): )
E/flutter (11083): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:652)
E/flutter (11083): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:310)
E/flutter (11083):
E/flutter (11083): #2 MethodChannel.invokeMapMethod (package:flutter/src/services/platform_channel.dart:510)
E/flutter (11083):
E/flutter (11083): #3 MethodChannelLocation.getLocation (package:location_platform_interface/src/method_channel_location.dart:83)
E/flutter (11083):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant