background_locator
background_locator copied to clipboard
[ANDROID] java.lang.IllegalStateException: FlutterCallbackInformati…formation(callbackHandle) must not be null
Causes many crashes on android. Here are the crash logs:
Fatal Exception: java.lang.RuntimeException: Unable to create service rekab.app.background_locator.IsolateHolderService: java.lang.IllegalStateException: FlutterCallbackInformati…formation(callbackHandle) must not be null
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3484)
at android.app.ActivityThread.-wrap4(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1702)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6710)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:770)
Caused by java.lang.IllegalStateException: FlutterCallbackInformati…formation(callbackHandle) must not be null
at rekab.app.background_locator.IsolateHolderExtensionKt.startLocatorService(IsolateHolderExtensionKt.java:58)
at rekab.app.background_locator.IsolateHolderService.onCreate(IsolateHolderService.java:3)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3474)
at android.app.ActivityThread.-wrap4(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1702)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6710)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:770)
Hi @Wian-TMC Thank you for opening an issue;
- Make sure you have global
callback
function; - Please add some breakpoints around this line to see if you can catch more information about the null field; https://github.com/rekab-app/background_locator/blob/b2fcb125001796f186189cbca970782da244c8f6/android/src/main/kotlin/rekab/app/background_locator/IsolateHolderExtension.kt#L26
My callback is a static void function within a global scope of a helper class. So I think some more digging is necessary to get to the bottom of this issue. The issue happens quite randomly on different devices, so testing with breakpoints and hoping it breaks may take some time.
Recently I can see lots of issues relating to FlutterCallbackInformation
. So there might be something wrong with that.
I'll try to dig a little and read some documents about it, I also appreciate any help and suggestion;
Could be. Some flutter engine updates do include unknown breaking changes
Might be related to #264 . Callback value is Int not Long and it ends up as NULL because of ?.