Bug 519184 - Android: Crash on startup when failing to go fullscreen
Summary: Android: Crash on startup when failing to go fullscreen
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (other bugs)
Version First Reported In: 5.3.1.1
Platform: Android Android 7.x
: NOR crash
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
: 520374 (view as bug list)
Depends on:
Blocks:
 
Reported: 2026-04-20 16:02 UTC by Freya Lupen
Modified: 2026-05-25 16:06 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Freya Lupen 2026-04-20 16:02:34 UTC
SUMMARY
Krita 5.3.1(.1) crashes on startup on my old device, but not other devices. logcat shows:

> 04-06 11:11:33.336 21210 21210 E krita.MainActivity: Failed to enter fullscreen
> 04-06 11:11:33.336 21210 21210 E krita.MainActivity: java.lang.NullPointerException: Attempt to invoke virtual method 'void > android.view.View.requestLayout()' on a null object reference
> 04-06 11:11:33.336 21210 21210 E krita.MainActivity: 	at org.qtproject.qt5.android.QtActivityDelegate.setFullScreen(r8-> map-id-de68625f794a6cb9b53c29a96a04e6fb0261fa39ca10aef2ca0e6306d97babf2:100)
> 04-06 11:11:33.336 21210 21210 E krita.MainActivity: 	at org.qtproject.qt5.android.bindings.QtActivity.setFullScreen(r8-> map-id-de68625f794a6cb9b53c29a96a04e6fb0261fa39ca10aef2ca0e6306d97babf2:5)
> 04-06 11:11:33.336 21210 21210 E krita.MainActivity: 	at org.krita.android.MainActivity.onStart(r8-map-id-> de68625f794a6cb9b53c29a96a04e6fb0261fa39ca10aef2ca0e6306d97babf2:11)
> 04-06 11:11:33.336 21210 21210 E krita.MainActivity: 	at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1249)

STEPS TO REPRODUCE
Open Krita

OBSERVED RESULT
"fatal error"

EXPECTED RESULT
Krita starts

SOFTWARE/OS VERSIONS
Krita 5.3.1.1, Android 7.1 arm32

ADDITIONAL INFORMATION
5.3.0-prealpha-5a235908 from December doesn't crash, despite that it should also go fullscreen on startup. 5.4.0-prealpha-79e44113 (from April) does crash.
Comment 1 Freya Lupen 2026-05-22 20:19:24 UTC
Took another look at this and found the actual cause. Preceding the "Failed to enter fullscreen" message is
> 04-06 11:08:29.668 21141 21141 W System.err: Caused by: java.lang.NoSuchMethodError: No virtual method setFocusedByDefault(Z)V in class Landroid/view/ViewGroup; or its super classes (declaration of 'android.view.ViewGroup' appears in /system/framework/framework.jar:classes2.dex)
> 04-06 11:08:29.668 21141 21141 W System.err: 	at org.qtproject.qt5.android.QtLayout.initializeFocus(r8-map-id-de68625f794a6cb9b53c29a96a04e6fb0261fa39ca10aef2ca0e6306d97babf2:8)

setFocusedByDefault doesn't exist on Android 7 (nor does setFocusable).
That causes QtLayout to break, which causes it to fail to go fullscreen.
That function call was added by the "Android text input fixes" Qt patch (https://invent.kde.org/szaman/qtbase/-/merge_requests/12/).
Comment 2 dra.w.p.il.e+bugskde 2026-05-22 23:45:58 UTC
Fix is pending here https://invent.kde.org/szaman/qtbase/-/merge_requests/18

`setFocusable` *does* exist on Android 7 (all the way down to 1), they just added another overload of it later, but we're not calling that.
Comment 3 Tiar 2026-05-23 20:56:50 UTC
*** Bug 520374 has been marked as a duplicate of this bug. ***
Comment 4 Freya Lupen 2026-05-25 16:06:18 UTC
The above fix was merged and I confirmed it works with my own build. It should be in the upcoming 5.3.2 release.