You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.app.Application android.app.Activity.getApplication()' on a null object reference
E/AndroidRuntime( 5340): at com.github.adee42.keyboardvisibility.KeyboardVisibilityPlugin.registerWith(KeyboardVisibilityPlugin.java:107)
E/AndroidRuntime( 5340): at io.flutter.plugins.GeneratedPluginRegistrant.registerWith(GeneratedPluginRegistrant.java:38)
E/AndroidRuntime( 5340): at com.example.app.Application.registerWith(Application.kt:17)
E/AndroidRuntime( 5340): at io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService.startBackgroundIsolate(FlutterFirebaseMessagingService.java:164)
E/AndroidRuntime( 5340): at io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService.onCreate(FlutterFirebaseMessagingService.java:77)
E/AndroidRuntime( 5340): at android.app.ActivityThread.handleCreateService(ActivityThread.java:3953)
at registrar.activity().getApplication().registerActivityLifecycleCallbacks(instance);
where registrar.activity() return null because registration is happening in Application class, can you have a null check set for this.
The text was updated successfully, but these errors were encountered:
I just looked at the PR's, because I was thinking of making one and found somebody has already beat me to it, and that fix was forked over and is now available over here https://github.com/MisterJimson/flutter_keyboard_visibility and this is the working fine!
The issue is due to the fact that the Firebase Messaging plugin is creating a headless isolate (not associated to a view or activity) which results in the call to registerWith() method with a null activity.
the crash happens in line 107 of https://github.com/adee42/flutter_keyboard_visibility/blob/master/android/src/main/java/com/github/adee42/keyboardvisibility/KeyboardVisibilityPlugin.java
at registrar.activity().getApplication().registerActivityLifecycleCallbacks(instance);
where registrar.activity() return null because registration is happening in Application class, can you have a null check set for this.
The text was updated successfully, but these errors were encountered: