Skip to content

Bump to 4.3.4: Android flet debug stale-code fix (flet #6682)#235

Merged
FeodorFitsner merged 1 commit into
mainfrom
bump-4.3.4
Jul 18, 2026
Merged

Bump to 4.3.4: Android flet debug stale-code fix (flet #6682)#235
FeodorFitsner merged 1 commit into
mainfrom
bump-4.3.4

Conversation

@FeodorFitsner

Copy link
Copy Markdown
Contributor

Summary

Fixes flet-dev/flet#6682 — code edits not taking effect under flet debug android.

flet debug android re-packages the app, rebuilds the APK, and flutter run -d <device> reinstalls it, so the new code is inside the freshly installed APK's assets. But on Android, prepareApp copies the app payload out of the APK to a writable dir only when a cache key changes, and that key was versionName+versionCode (e.g. 1.0.0+1).

flet debug never bumps the version between iterations, and flutter run does an update install that preserves app data — including the .key cache marker and the previously-unpacked app/ dir. So the key never changed → re-extraction was skipped → the app kept running stale code.

This is Android-only: iOS/desktop run the app straight from the read-only app bundle, which flutter run fully replaces each reinstall. flet build apk was unaffected (fresh/version-bumped install).

Fix

getAppVersion now appends PackageManager.lastUpdateTime to the returned version string. It's bumped on every (re)install but stays stable across plain relaunches — so a flet debug reinstall invalidates the extraction cache and unpacks the new code, while ordinary relaunches still hit the cache with no per-launch cost.

  • AndroidPlugin.java — append + lastUpdateTime to the getAppVersion result.
  • serious_python_android.dart — comment documenting why the cache key depends on that reinstall-sensitive value (the Dart side treats the string as opaque, so no logic change).

Release

Bumps all six packages to 4.3.4. No python-build snapshot change — bundled Python (3.12.13 / 3.13.14 / 3.14.6) and dart_bridge (1.5.0) are unchanged from 4.3.3. CHANGELOG: substantive entry in serious_python_android, cross-referenced summary in serious_python, alignment lines elsewhere.

Verification

Not exercised on a device in this change. Suggested end-to-end check: flet debug android → confirm app shows → edit main.pyflet debug android again → confirm the edit now appears (previously it wouldn't).

`flet debug android` kept running previously-unpacked, stale app code after
a re-run. `prepareApp` copies the app payload out of the APK only when its
cache key changes, and the key was `versionName+versionCode`. `flet debug`
reinstalls the same-version APK on each iteration (`flutter run` does an
update install that preserves app data, including the cache marker), so the
key never changed and re-extraction was skipped.

`getAppVersion` now appends `PackageManager.lastUpdateTime` to the key,
which is bumped on every (re)install but stays stable across plain
relaunches — so a debug reinstall re-extracts the new code while ordinary
relaunches still hit the cache. `flet build apk` was unaffected.
@FeodorFitsner
FeodorFitsner merged commit 1d241a4 into main Jul 18, 2026
29 of 58 checks passed
@FeodorFitsner
FeodorFitsner deleted the bump-4.3.4 branch July 18, 2026 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant