Open joandervieira opened 3 years ago
I have similar problem, I think. It's occurs after few minutes afer service starts.
2021-08-16 11:59:28.087 1296-1918/? E/ClipboardService: Denying clipboard access to com.example.test2, application is not in focus neither is a system service for user 0
2021-08-16 12:22:56.538 15490-15490/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.test2, PID: 15490
java.lang.RuntimeException: Unable to create service rekab.app.background_locator.IsolateHolderService: java.lang.NullPointerException: Attempt to read from field 'java.lang.String io.flutter.view.FlutterCallbackInformation.callbackLibraryPath' on a null object reference
at android.app.ActivityThread.handleCreateService(ActivityThread.java:4050)
at android.app.ActivityThread.access$1700(ActivityThread.java:230)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1927)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:224)
at android.app.ActivityThread.main(ActivityThread.java:7551)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:995)
Caused by: java.lang.NullPointerException: Attempt to read from field 'java.lang.String io.flutter.view.FlutterCallbackInformation.callbackLibraryPath' on a null object reference
at io.flutter.embedding.engine.e.a$b.toString(Unknown Source:22)
at java.lang.String.valueOf(String.java:2924)
at java.lang.StringBuilder.append(StringBuilder.java:132)
at io.flutter.embedding.engine.e.a.a(Unknown Source:22)
at rekab.app.background_locator.b.a(Unknown Source:105)
at rekab.app.background_locator.IsolateHolderService.onCreate(Unknown Source:3)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:4038)
at android.app.ActivityThread.access$1700(ActivityThread.java:230)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1927)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:224)
at android.app.ActivityThread.main(ActivityThread.java:7551)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:995)
2021-08-16 12:23:00.723 15544-15544/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.test2, PID: 15544
java.lang.UnsatisfiedLinkError: No implementation found for io.flutter.view.FlutterCallbackInformation io.flutter.embedding.engine.FlutterJNI.nativeLookupCallbackInformation(long) (tried Java_io_flutter_embedding_engine_FlutterJNI_nativeLookupCallbackInformation and Java_io_flutter_embedding_engine_FlutterJNI_nativeLookupCallbackInformation__J)
at io.flutter.embedding.engine.FlutterJNI.nativeLookupCallbackInformation(Native Method)
at io.flutter.view.FlutterCallbackInformation.lookupCallbackInformation(Unknown Source:0)
at rekab.app.background_locator.b.a(Unknown Source:56)
at rekab.app.background_locator.IsolateHolderService.onCreate(Unknown Source:3)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:4038)
at android.app.ActivityThread.access$1700(ActivityThread.java:230)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1927)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:224)
at android.app.ActivityThread.main(ActivityThread.java:7551)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:995)
2021-08-16 12:53:24.563 17739-17739/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.test2, PID: 17739
java.lang.UnsatisfiedLinkError: No implementation found for io.flutter.view.FlutterCallbackInformation io.flutter.embedding.engine.FlutterJNI.nativeLookupCallbackInformation(long) (tried Java_io_flutter_embedding_engine_FlutterJNI_nativeLookupCallbackInformation and Java_io_flutter_embedding_engine_FlutterJNI_nativeLookupCallbackInformation__J)
at io.flutter.embedding.engine.FlutterJNI.nativeLookupCallbackInformation(Native Method)
at io.flutter.view.FlutterCallbackInformation.lookupCallbackInformation(Unknown Source:0)
at rekab.app.background_locator.b.a(Unknown Source:56)
at rekab.app.background_locator.IsolateHolderService.onCreate(Unknown Source:3)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:4038)
at android.app.ActivityThread.access$1700(ActivityThread.java:230)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1927)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:224)
at android.app.ActivityThread.main(ActivityThread.java:7551)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:995)
@joandervieira have you override the below method from mainactivity?
@Override public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) { GeneratedPluginRegistrant.registerWith(flutterEngine); }
Hi @joandervieira Thank you for opening an issue;
This is the only place that I look into FlutterCallbackInformation
.
please make sure you have a global callback
function.
You can also add some breakpoints around here and check if you can find more info;
Hi @mehdok
When system tries to restart foreground service (example after power manager app kills process) I get similar errors and service doesn't start:
java.lang.UnsatisfiedLinkError: No implementation found for io.flutter.view.FlutterCallbackInformation io.flutter.embedding.engine.FlutterJNI.nativeLookupCallbackInformation(long) (tried Java_io_flutter_embedding_engine_FlutterJNI_nativeLookupCallbackInformation and Java_io_flutter_embedding_engine_FlutterJNI_nativeLookupCallbackInformation__J)
You can simulate it via adb usingi the example app in this project:
adb shell am start-foreground-service rekab.app.background_locator_example/rekab.app.background_locator.IsolateHolderService
Before execute this command make sure you kill app rekab.app.background_locator_example
This error occurs when BackgroundLocator.initialize is not called
Experiencing same issue
Anyone know how to fix? I'm experiencing the same issue
The background locator do not start on Android:
Log error:
The AndroidManifest.xml file:
My android package:
The MainActivity.kt:
The GeneratedPluginRegistrant.java:
The flutter doctor: