More or less 1 out of the 8 times I render LaTeX with TeXView my app crashes when running on a Moto One (Android). It is very random.
Sometimes I get this error, this one usually happens when I have a TeXView in one route and I push another route with a TeXView:
E/AndroidRuntime(13787): FATAL EXCEPTION: main
E/AndroidRuntime(13787): Process: com.app.my_app, PID: 13787
E/AndroidRuntime(13787): java.lang.NullPointerException: Attempt to read from field 'android.view.WindowManager$LayoutParams android.view.ViewRootImpl.mWindowAttributes' on a null object reference
E/AndroidRuntime(13787): at android.view.inputmethod.InputMethodManager.startInputInner(InputMethodManager.java:1625)
E/AndroidRuntime(13787): at android.view.inputmethod.InputMethodManager.checkFocus(InputMethodManager.java:1864)
E/AndroidRuntime(13787): at android.view.inputmethod.InputMethodManager.isActive(InputMethodManager.java:1183)
E/AndroidRuntime(13787): at io.flutter.plugins.d.l2$a.run(Unknown Source:42)
E/AndroidRuntime(13787): at android.os.Handler.handleCallback(Handler.java:883)
E/AndroidRuntime(13787): at android.os.Handler.dispatchMessage(Handler.java:100)
E/AndroidRuntime(13787): at android.os.Looper.loop(Looper.java:241)
E/AndroidRuntime(13787): at android.app.ActivityThread.main(ActivityThread.java:7617)
E/AndroidRuntime(13787): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(13787): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
E/AndroidRuntime(13787): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:941)
And sometimes I get this other error:
PlatformException (PlatformException(error, Permission Denial: get/set setting for user asks to run as user -2 but is calling from uid u0a279; this requires android.permission.INTERACT_ACROSS_USERS_FULL, null, java.lang.SecurityException: Permission Denial: get/set setting for user asks to run as user -2 but is calling from uid u0a279; this requires android.permission.INTERACT_ACROSS_USERS_FULL
at android.os.Parcel.createException(Parcel.java:2071)
at android.os.Parcel.readException(Parcel.java:2039)
at android.os.Parcel.readException(Parcel.java:1987)
at android.view.IWindowSession$Stub$Proxy.addToDisplay(IWindowSession.java:1242)
at android.view.ViewRootImpl.setView(ViewRootImpl.java:889)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:387)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:95)
at android.app.Dialog.show(Dialog.java:342)
at android.app.Presentation.show(Presentation.java:257)
at io.flutter.plugin.platform.VirtualDisplayController.(VirtualDisplayController.java:95)
at io.flutter.plugin.platform.VirtualDisplayController.create(VirtualDisplayController.java:48)
at io.flutter.plugin.platform.PlatformViewsController$1.createVirtualDisplayForPlatformView(PlatformViewsController.java:212)
at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:107)
at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:59)
at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:84)
at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:865)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:343)
at android.os.Looper.loop(Looper.java:188)
at android.app.ActivityThread.main(ActivityThread.java:7617)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:941)
Caused by: android.os.RemoteException: Remote stack trace:
at com.android.server.am.UserController.handleIncomingUser(UserController.java:1660)
at com.android.server.am.ActivityManagerService.handleIncomingUser(ActivityManagerService.java:14500)
at android.app.ActivityManager.handleIncomingUser(ActivityManager.java:3813)
at com.motorola.android.providers.settings.MotorolaSettingsProvider.resolveCallingUserIdEnforcingPermissionsLocked(MotorolaSettingsProvider.java:1154)
at com.motorola.android.providers.settings.MotorolaSettingsProvider.getSecureSetting(MotorolaSettingsProvider.java:791)
))
flutter doctor -v:
[✓] Flutter (Channel stable, 2.5.3, on Ubuntu 20.04.3 LTS 5.4.0-91-generic, locale en_US.UTF-8)
• Flutter version 2.5.3 at /home/willem/snap/flutter/common/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 18116933e7 (7 weeks ago), 2021-10-15 10:46:35 -0700
• Engine revision d3ea636dc5
• Dart version 2.14.4
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /home/willem/Android/Sdk
• Platform android-30, build-tools 29.0.2
• Java binary at: /opt/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
• All Android licenses accepted.
[✓] Linux toolchain - develop for Linux desktop
• clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
• cmake version 3.10.2
• ninja version 1.8.2
• pkg-config version 0.29.1
[✓] Android Studio (version 4.0)
• Android Studio at /opt/android-studio
• Flutter plugin version 49.0.2
• Dart plugin version 193.7547
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[✓] VS Code
• VS Code at /snap/code/current
• Flutter extension version 3.29.0
More or less 1 out of the 8 times I render LaTeX with TeXView my app crashes when running on a Moto One (Android). It is very random.
Sometimes I get this error, this one usually happens when I have a TeXView in one route and I push another route with a TeXView: E/AndroidRuntime(13787): FATAL EXCEPTION: main E/AndroidRuntime(13787): Process: com.app.my_app, PID: 13787 E/AndroidRuntime(13787): java.lang.NullPointerException: Attempt to read from field 'android.view.WindowManager$LayoutParams android.view.ViewRootImpl.mWindowAttributes' on a null object reference E/AndroidRuntime(13787): at android.view.inputmethod.InputMethodManager.startInputInner(InputMethodManager.java:1625) E/AndroidRuntime(13787): at android.view.inputmethod.InputMethodManager.checkFocus(InputMethodManager.java:1864) E/AndroidRuntime(13787): at android.view.inputmethod.InputMethodManager.isActive(InputMethodManager.java:1183) E/AndroidRuntime(13787): at io.flutter.plugins.d.l2$a.run(Unknown Source:42) E/AndroidRuntime(13787): at android.os.Handler.handleCallback(Handler.java:883) E/AndroidRuntime(13787): at android.os.Handler.dispatchMessage(Handler.java:100) E/AndroidRuntime(13787): at android.os.Looper.loop(Looper.java:241) E/AndroidRuntime(13787): at android.app.ActivityThread.main(ActivityThread.java:7617) E/AndroidRuntime(13787): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(13787): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) E/AndroidRuntime(13787): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:941)
And sometimes I get this other error: PlatformException (PlatformException(error, Permission Denial: get/set setting for user asks to run as user -2 but is calling from uid u0a279; this requires android.permission.INTERACT_ACROSS_USERS_FULL, null, java.lang.SecurityException: Permission Denial: get/set setting for user asks to run as user -2 but is calling from uid u0a279; this requires android.permission.INTERACT_ACROSS_USERS_FULL at android.os.Parcel.createException(Parcel.java:2071) at android.os.Parcel.readException(Parcel.java:2039) at android.os.Parcel.readException(Parcel.java:1987) at android.view.IWindowSession$Stub$Proxy.addToDisplay(IWindowSession.java:1242) at android.view.ViewRootImpl.setView(ViewRootImpl.java:889) at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:387) at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:95) at android.app.Dialog.show(Dialog.java:342) at android.app.Presentation.show(Presentation.java:257) at io.flutter.plugin.platform.VirtualDisplayController.(VirtualDisplayController.java:95)
at io.flutter.plugin.platform.VirtualDisplayController.create(VirtualDisplayController.java:48)
at io.flutter.plugin.platform.PlatformViewsController$1.createVirtualDisplayForPlatformView(PlatformViewsController.java:212)
at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:107)
at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:59)
at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:84)
at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:865)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:343)
at android.os.Looper.loop(Looper.java:188)
at android.app.ActivityThread.main(ActivityThread.java:7617)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:941)
Caused by: android.os.RemoteException: Remote stack trace:
at com.android.server.am.UserController.handleIncomingUser(UserController.java:1660)
at com.android.server.am.ActivityManagerService.handleIncomingUser(ActivityManagerService.java:14500)
at android.app.ActivityManager.handleIncomingUser(ActivityManager.java:3813)
at com.motorola.android.providers.settings.MotorolaSettingsProvider.resolveCallingUserIdEnforcingPermissionsLocked(MotorolaSettingsProvider.java:1154)
at com.motorola.android.providers.settings.MotorolaSettingsProvider.getSecureSetting(MotorolaSettingsProvider.java:791)
))
flutter doctor -v: [✓] Flutter (Channel stable, 2.5.3, on Ubuntu 20.04.3 LTS 5.4.0-91-generic, locale en_US.UTF-8) • Flutter version 2.5.3 at /home/willem/snap/flutter/common/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 18116933e7 (7 weeks ago), 2021-10-15 10:46:35 -0700 • Engine revision d3ea636dc5 • Dart version 2.14.4
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2) • Android SDK at /home/willem/Android/Sdk • Platform android-30, build-tools 29.0.2 • Java binary at: /opt/android-studio/jre/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593) • All Android licenses accepted.
[✓] Linux toolchain - develop for Linux desktop • clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final) • cmake version 3.10.2 • ninja version 1.8.2 • pkg-config version 0.29.1
[✓] Android Studio (version 4.0) • Android Studio at /opt/android-studio • Flutter plugin version 49.0.2 • Dart plugin version 193.7547 • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[✓] VS Code • VS Code at /snap/code/current • Flutter extension version 3.29.0
[✓] Connected device (3 available) • motorola one action (mobile) • ZY326HZHGM • android-arm64 • Android 10 (API 29) • Linux (desktop) • linux • linux-x64 • Ubuntu 20.04.3 LTS 5.4.0-91-generic • Chrome (web) • chrome • web-javascript • Google Chrome 96.0.4664.45
• No issues found!