question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Crash on landscape mode

See original GitHub issue

Short description

Today i wanted to test the new features that you made on Smartbar rework PR to see new option overflow menu everything is good and works great i like it but it have a small bug when you use phone in landscape mode(horizontal mode) and click on overflow menu the keyboard stops working and suddenly crash.

Steps to reproduce

  1. Go to ‘Any app in landscape mode’
  2. Click on ‘Overflow menu’
  3. See crash

Environment information

  • FlorisBoard 0.4.0-debug-7be6c13 (88)
  • Device: Samsung SM-G781B (r8qxeea)
  • Android: 12 (cn=S sdk=31)

Attached logs and stacktrace files

Detailed info (Debug log header)
======= SYSTEM INFO =======
Time                : 2022-08-22T13:09:52.780406Z
Manufacturer        : samsung
Model               : SM-G781B
Product             : r8qxeea
Android             : 12 (cn=S sdk=31) [SP1A.210812.016.G781BXXS4FVF3]
ABIs                : [arm64-v8a, armeabi-v7a, armeabi]
Memory              : 3.77 GiB (68.65% used, 5.50 GiB max)
Font scale          : 0.9
Locales             : en-GB

======= APP INFO =======
Package             : dev.patrickgold.florisboard.debug
Name                : FlorisBoard Debug
Version             : 0.4.0-debug-7be6c13 (88)
Build type          : debug
Build commit hash   : 7be6c135ef7fb54624c1ab62b1a7f14efd823bb4
Java heap memory    : 36.91 MiB (14.42% used, 256.00 MiB max)
Native heap memory  : 30.94 MiB (96.19% used, 32.17 MiB max)

======= FEATURE CONFIG =======
Smartbar enabled            : true
Suggestions enabled         : false
Inline autofill enabled     : true
Glide enabled               : false
Internal clipboard enabled  : false

1661173784145.stacktrace
java.lang.IllegalArgumentException: Requested element count -2 is less than zero.
	at kotlin.collections.CollectionsKt___CollectionsKt.takeLast(_Collections.kt:914)
	at dev.patrickgold.florisboard.ime.smartbar.quickaction.QuickActionsOverflowPanelKt.QuickActionsOverflowPanel(QuickActionsOverflowPanel.kt:55)
	at dev.patrickgold.florisboard.ime.text.TextInputLayoutKt$TextInputLayout$1.invoke(TextInputLayout.kt:63)
	at dev.patrickgold.florisboard.ime.text.TextInputLayoutKt$TextInputLayout$1.invoke(TextInputLayout.kt:55)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
	at androidx.compose.runtime.RecomposeScopeImpl.compose(RecomposeScopeImpl.kt:145)
	at androidx.compose.runtime.ComposerImpl.recomposeToGroupEnd(Composer.kt:2363)
	at androidx.compose.runtime.ComposerImpl.skipToGroupEnd(Composer.kt:2653)
	at dev.patrickgold.florisboard.ime.text.TextInputLayoutKt.TextInputLayout(TextInputLayout.kt:84)
	at dev.patrickgold.florisboard.FlorisImeService$ImeUi$2$3$1$1.invoke(FlorisImeService.kt:605)
	at dev.patrickgold.florisboard.FlorisImeService$ImeUi$2$3$1$1.invoke(FlorisImeService.kt:598)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
	at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
	at dev.patrickgold.florisboard.FlorisImeService$ImeUi$2$3.invoke(FlorisImeService.kt:598)
	at dev.patrickgold.florisboard.FlorisImeService$ImeUi$2$3.invoke(FlorisImeService.kt:571)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:116)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
	at dev.patrickgold.florisboard.lib.snygg.ui.SnyggSurfaceKt$SnyggSurface$1.invoke(SnyggSurface.kt:99)
	at dev.patrickgold.florisboard.lib.snygg.ui.SnyggSurfaceKt$SnyggSurface$1.invoke(SnyggSurface.kt:52)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
	at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
	at dev.patrickgold.florisboard.lib.snygg.ui.SnyggSurfaceKt.SnyggSurface(SnyggSurface.kt:49)
	at dev.patrickgold.florisboard.FlorisImeService$ImeUi$2.invoke(FlorisImeService.kt:563)
	at dev.patrickgold.florisboard.FlorisImeService$ImeUi$2.invoke(FlorisImeService.kt:562)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
	at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
	at dev.patrickgold.florisboard.FlorisImeService.ImeUi(FlorisImeService.kt:562)
	at dev.patrickgold.florisboard.FlorisImeService.access$ImeUi(FlorisImeService.kt:137)
	at dev.patrickgold.florisboard.FlorisImeService$ImeUi$3.invoke(Unknown Source:6)
	at dev.patrickgold.florisboard.FlorisImeService$ImeUi$3.invoke(Unknown Source:10)
	at androidx.compose.runtime.RecomposeScopeImpl.compose(RecomposeScopeImpl.kt:145)
	at androidx.compose.runtime.ComposerImpl.recomposeToGroupEnd(Composer.kt:2363)
	at androidx.compose.runtime.ComposerImpl.skipCurrentGroup(Composer.kt:2630)
	at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:3217)
	at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:3195)
	at androidx.compose.runtime.SnapshotStateKt__DerivedStateKt.observeDerivedStateRecalculations(DerivedState.kt:336)
	at androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations(Unknown Source:1)
	at androidx.compose.runtime.ComposerImpl.doCompose(Composer.kt:3195)
	at androidx.compose.runtime.ComposerImpl.recompose$runtime_release(Composer.kt:3160)
	at androidx.compose.runtime.CompositionImpl.recompose(Composition.kt:748)
	at androidx.compose.runtime.Recomposer.performRecompose(Recomposer.kt:876)
	at androidx.compose.runtime.Recomposer.access$performRecompose(Recomposer.kt:107)
	at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$2.invoke(Recomposer.kt:485)
	at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$2.invoke(Recomposer.kt:454)
	at androidx.compose.ui.platform.AndroidUiFrameClock$withFrameNanos$2$callback$1.doFrame(AndroidUiFrameClock.android.kt:34)
	at androidx.compose.ui.platform.AndroidUiDispatcher.performFrameDispatch(AndroidUiDispatcher.android.kt:109)
	at androidx.compose.ui.platform.AndroidUiDispatcher.access$performFrameDispatch(AndroidUiDispatcher.android.kt:41)
	at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.doFrame(AndroidUiDispatcher.android.kt:69)
	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1106)
	at android.view.Choreographer.doCallbacks(Choreographer.java:866)
	at android.view.Choreographer.doFrame(Choreographer.java:792)
	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1092)
	at android.os.Handler.handleCallback(Handler.java:938)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loopOnce(Looper.java:226)
	at android.os.Looper.loop(Looper.java:313)
	at android.app.ActivityThread.main(ActivityThread.java:8669)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
	Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [androidx.compose.runtime.PausableMonotonicFrameClock@7295976, androidx.compose.ui.platform.MotionDurationScaleImpl@d213b77, StandaloneCoroutine{Cancelling}@c4ec3e4, AndroidUiDispatcher@391104d]

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:17 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
patrickgoldcommented, Aug 28, 2022

I found a semi-reliable way to reproduce the crash:

  1. Open an app and focus a text field.
  2. Click the Settings icon from the Smartbar
  3. Open the Android activity view and slide FlorisBoard away
  4. Click on the app with the text field again
  5. Immediately even before the the keyboard has any chance to show lock your device
  6. Unlock it again
  7. See crash every second time or so (method not always works)

Above linked commit now forces the observers of the KeyboardManager on the Main thread and the bug should not occur anymore. I’ve tested it using my method a lot of times and with different apps and after the fix I was not able to reproduce the crash at all anymore, so I hope it is now fixed.

1reaction
patrickgoldcommented, Aug 23, 2022

Thanks for your bug report on a version that isn’t even released 😃

The first crash has been fixed, in landscape the overflow panel has no actions to show which it didn’t expect and then crashed.

The second crash you commented is something I experienced once too but cannot reproduce since then, do you have any concrete way to reproduce this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

My app is crashing in landscape mode - android
I don't know what's wrong, whenever I launch my app on an Emulator and I switch to landscape mode, it crashes. But it...
Read more >
Landscape mode crashing - Samsung Community - 2057342
Landscape mode crashing · Turn off the device. · Press and hold the Volume Up key and the Side key. · When the...
Read more >
Video crashes after changing to landscape mode on IOS Device
On two IOS devices (Ipad Pro and Iphone 13 pro max) we have the problem, that the video is crashing in a meeting...
Read more >
app crash when screen orientation changes???
Caution: Beginning with Android 3.2 (API level 13), the "screen size" also changes when the device switches between portrait and landscape orientation.
Read more >
Apple TV stop working when I try landscape
When i open apple tv app on my iphone 13 then try landscape the app crash. My phone just got updated to ios...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found