Skip to content

Bump to 4.3.1: Android x86_64 empty sitepackages.zip fix#229

Merged
FeodorFitsner merged 2 commits into
mainfrom
bump-4.3.1
Jul 10, 2026
Merged

Bump to 4.3.1: Android x86_64 empty sitepackages.zip fix#229
FeodorFitsner merged 2 commits into
mainfrom
bump-4.3.1

Conversation

@FeodorFitsner

Copy link
Copy Markdown
Contributor

Problem

flet build apk --arch x86_64 (any --arch subset not including arm64-v8a) produced an APK with an empty sitepackages.zip: the app shipped with no Python site-packages at all, and the bootstrap's very first dependency import (e.g. import certifi) failed at startup. Reported against flet 0.86.0.dev2 / serious_python 4.3.0.

Root cause

Since the 4.3.0 native-mmap packaging, the pure-code zips (sitepackages.zip / extract.zip) are ABI-common assets built once from a "primary" ABI, hardcoded as abis.first() from python_versions.properties — always arm64-v8a. With --arch x86_64, flet stages only build/site-packages/x86_64/; the primary split task then walks the nonexistent arm64-v8a/ dir (Kotlin's walkTopDown() on a missing root yields nothing) and silently writes a valid-but-empty stored zip. The default build worked only because it happens to stage arm64-v8a.

Fix

primaryAbi is now the first manifest ABI whose per-ABI tree actually exists under SERIOUS_PYTHON_SITE_PACKAGES. If none is staged — legitimate when packaging with no requirements (the package command skips staging entirely, so this must not be an error) — fall back to abis.first(), whose empty walk correctly yields empty zips, and log sitepackages.zip will be empty so that state is visible in the build log instead of silent.

No flet-cli change needed: Gradle infers the staged ABI set on its own.

Verification

Reproduced the failing scenario locally with run_example:

  1. dart run serious_python:main package app/src -p Android --arch x86_64 ... → only build/site-packages/x86_64/ staged (no arm64-v8a/).
  2. flutter build apk --debug --target-platform android-x64 → before the fix this produced a ~22-byte sitepackages.zip; after the fix it's 25 MB, containing numpy, jnius, lru + dist-infos, with 21 .soref markers resolving to 83 relocated native libs in lib/x86_64/.

Release

Standard aligned bump of all six packages to 4.3.1; only serious_python_android has a substantive change, the rest are alignment-only CHANGELOG entries. Prepared per the release process — not tagged/published.

The substantive change is in serious_python_android: the ABI-common
sitepackages.zip / extract.zip assets were built from a hardcoded primary
ABI (abis.first() = arm64-v8a). When `flet build apk --arch x86_64` staged
only x86_64 site-packages, the primary split task walked a nonexistent
directory and silently shipped a valid-but-empty sitepackages.zip - the app
had no Python dependencies and the first import failed at startup.

The primary ABI is now the first manifest ABI whose site-packages tree was
actually staged under SERIOUS_PYTHON_SITE_PACKAGES. If none is staged
(legitimate when packaging with no requirements), fall back to abis.first()
and log a warning instead of staying silent.

All other packages are alignment-only bumps.
@FeodorFitsner FeodorFitsner merged commit dd67d0f into main Jul 10, 2026
40 of 54 checks passed
@FeodorFitsner FeodorFitsner deleted the bump-4.3.1 branch July 10, 2026 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants