daily-demos / daily-flutter-demo

BSD 2-Clause "Simplified" License
4 stars 1 forks source link

Android crasher when app is in the background (exiting)? #12

Open jd-bus opened 2 months ago

jd-bus commented 2 months ago

We are seeing this crasher across ~all Android users. According to Crashylitcs the app is in the background 100% of the time.

states versions phones

Based on the primary exception it appears that this may be occurring when the app is in the process of closing:

Fatal Exception: java.lang.RuntimeException
Unable to destroy activity {com.jdbus.packge/com.jdbus.packge.MainActivity}: java.lang.NullPointerException: getValue(...) must not be null
android.app.ActivityThread.performDestroyActivity (ActivityThread.java:5301)

com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1027)
DailyFlutterPlugin.getSurfaceTextureHelper
java.lang.NullPointerException - getValue(...) must not be null
co.daily.daily_flutter
DailyFlutterPlugin.java:8
Caused by java.lang.NullPointerException
getValue(...) must not be null
co.daily.daily_flutter.DailyFlutterPlugin.getSurfaceTextureHelper (DailyFlutterPlugin.java:8)
co.daily.daily_flutter.DailyFlutterPlugin.onDetachedFromEngine (DailyFlutterPlugin.java:29)
io.flutter.embedding.engine.FlutterEngineConnectionRegistry.remove (FlutterEngineConnectionRegistry.java:59)
io.flutter.embedding.engine.FlutterEngineConnectionRegistry.remove (FlutterEngineConnectionRegistry.java:16)
io.flutter.embedding.engine.FlutterEngineConnectionRegistry.removeAll (FlutterEngineConnectionRegistry.java:11)
io.flutter.embedding.engine.FlutterEngineConnectionRegistry.destroy (FlutterEngineConnectionRegistry.java:10)
io.flutter.embedding.engine.FlutterEngine.destroy (FlutterEngine.java:31)
io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onDetach (FlutterActivityAndFragmentDelegate.java:105)
io.flutter.embedding.android.FlutterActivity.onDestroy (FlutterActivity.java:18)
android.app.Activity.performDestroy (Activity.java:8258)
android.app.Instrumentation.callActivityOnDestroy (Instrumentation.java:1341)
android.app.ActivityThread.performDestroyActivity (ActivityThread.java:5286)
android.app.ActivityThread.handleDestroyActivity (ActivityThread.java:5330)
android.app.servertransaction.DestroyActivityItem.execute (DestroyActivityItem.java:44)
android.app.servertransaction.TransactionExecutor.executeLifecycleState (TransactionExecutor.java:181)
android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:102)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:2235)
android.os.Handler.dispatchMessage (Handler.java:107)
android.os.Looper.loop (Looper.java:240)
android.app.ActivityThread.main (ActivityThread.java:7829)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:512)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1027)

This is running the demo code. Does something need to change with how the widget is destroyed? Thanks.