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
{{ message }}
Repository navigation
bug: Application crashes (only Android 8.1 and below and flet 0.81.0 and later) #6619
I have searched the opened issues and there are no duplicates
Describe the bug
When I create an application using flet for Android and install modern smartphones or tablets, but I know that it is possible to install at least Android 7. I tried to install an application of older Android versions, but I saw that Android 8.1 and older versions cause the application to crash.
But... I experimented and found out that flet version 0.80.5 and older versions do not crash the application. When the flet 0.81.0 update was released, the app started to fail in older versions of Android.
I do not know, maybe this is not a bug, or android is outdated? I think flet 0.81.0 and later versions do not support older Android versions.
1.Create a project: flet create myapp
2.Build an apk project: flet build apk myapp
3.Install the app using Android 8.1 and older versions (via android studio or an old phone that costs Android 8.1 and older)
4.Now, open the app
Expected behavior
No response
Screenshots / Videos
Captures
[Upload media here]
Screen_recording_20260626_235606.mp4
Operating System
Windows
Operating system details
10 Pro
Flet version
0.85.3
Regression
Yes, it used to work in a previous Flet version (please specify the version in additional details)
serious_python_android's getAppVersion handler — which runs on every app startup — calls PackageInfo.getLongVersionCode(), an API 28+ method, unconditionally. In release builds, R8 outlines that call into a synthetic class and merges into it the API-28 outlines from Flutter 3.41's new ImageDecoderDefaultImpl (which uses android.graphics.ImageDecoder). Invoking the version-code method on API < 28 forces that merged class to load, its ImageDecoder references fail to resolve, and the app crashes.
That explains the exact regression boundary: Flet 0.80.5 shipped Flutter 3.38.7 (no ImageDecoderDefaultImpl); Flet 0.81.0 bumped to Flutter 3.41.2, which added it. The unguarded getLongVersionCode() was always there, but only became fatal once Flutter contributed an ImageDecoder outline for R8 to merge with.
Verified on emulators with a stock flet create counter app (release APK): crashes on Android 8.0 / API 26, runs fine on Android 10 / API 29.
Fix
PR: flet-dev/serious-python#219 (guards the call with Build.VERSION.SDK_INT, falling back to the deprecated versionCode int on API < 28).
Workaround now (Flet 0.81.0–0.85.x)
Until a fixed serious_python is released, add this to your pyproject.toml to build against a patched branch, then rebuild with flet build apk. Note both entries are required — serious_python_android pulls in serious_python_platform_interface, so they must share the same source:
Activity
FeodorFitsner commentedon Jun 26, 2026
Looking into that.
FeodorFitsner commentedon Jun 27, 2026
Thanks for the detailed report and the exact version boundary — that was the key to tracking this down. I reproduced it and found the root cause.
What's happening
This is not a "Flet dropped old Android" issue and not a rendering/Impeller issue. The app crashes on launch on Android 8.1 and below (API < 28) with:
serious_python_android'sgetAppVersionhandler — which runs on every app startup — callsPackageInfo.getLongVersionCode(), an API 28+ method, unconditionally. In release builds, R8 outlines that call into a synthetic class and merges into it the API-28 outlines from Flutter 3.41's newImageDecoderDefaultImpl(which usesandroid.graphics.ImageDecoder). Invoking the version-code method on API < 28 forces that merged class to load, itsImageDecoderreferences fail to resolve, and the app crashes.That explains the exact regression boundary: Flet 0.80.5 shipped Flutter 3.38.7 (no
ImageDecoderDefaultImpl); Flet 0.81.0 bumped to Flutter 3.41.2, which added it. The unguardedgetLongVersionCode()was always there, but only became fatal once Flutter contributed anImageDecoderoutline for R8 to merge with.Verified on emulators with a stock
flet createcounter app (release APK): crashes on Android 8.0 / API 26, runs fine on Android 10 / API 29.Fix
PR: flet-dev/serious-python#219 (guards the call with
Build.VERSION.SDK_INT, falling back to the deprecatedversionCodeint on API < 28).Workaround now (Flet 0.81.0–0.85.x)
Until a fixed
serious_pythonis released, add this to yourpyproject.tomlto build against a patched branch, then rebuild withflet build apk. Note both entries are required —serious_python_androidpulls inserious_python_platform_interface, so they must share the same source:I verified this override end-to-end: with it, the counter app launches and runs correctly on Android 8.0 (API 26).