Skip to content

Test flet build settings for Android, iOS and macOS, and fix the bugs found - #7036

Open
ndonkoHenri wants to merge 11 commits into
feat/android-queries-6560from
test/android-build-settings
Open

ndonkoHenri wants to merge 11 commits into
feat/android-queries-6560from
test/android-build-settings

Conversation

@ndonkoHenri

@ndonkoHenri ndonkoHenri commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #7031, so this diff shows only its own changes.

Pins down what flet build writes for Android, iOS and macOS, and fixes the bugs that turned up while doing it.

Fixes

  • flet build ipa with special characters in export options: a [tool.flet.ios.export_options] value containing <, > or &, such as thinning = "<none>", produced an invalid exportOptions.plist, and numbers were written as strings.
  • flet build macos with & in the name: a product or artifact name containing & failed with Scheme Runner is not currently configured for the build action. Flutter's Swift Package Manager migration reads BuildableName with an XML parser and writes it back unescaped, which breaks the scheme even when the value is escaped. The schemes now use a fixed Runner.app; nothing else reads that value.
  • --permissions biometric: the CLI rejected this bundle, although it works from pyproject.toml. The bundles are now defined once in CROSS_PLATFORM_PERMISSIONS, which the CLI choices and the docs both use.

Breaking change

Custom --template templates must read the iOS export options from cookiecutter._options.ios_export_options (was cookiecutter.ios_export_options). Templates still using the old name leave them out of exportOptions.plist, without an error.

Refactor and tests

setup_template_data is split into methods for the Android, Info.plist, macOS entitlement and iOS signing settings, and test_build_android.py, test_build_ios.py and test_build_macos.py now cover those settings. build_base.py has a large diff, mostly moved code.

Testing

  • flet-cli tests on the branch tip: 1074 passed, 1 skipped.
  • & in the name: product = "Probe & Co" failed flet build macos before the fix, and Probe Co built as a control. After it, the macOS build succeeded and the app launched, and an iOS simulator build with artifact = "Probe & Co" succeeded.
  • Export options: the generated exportOptions.plist failed plistlib before the fix, and now passes plistlib and plutil -lint, with thinning as <none> and a number written as an integer.

Not tested: an actual IPA export, because the test Mac has no valid signing identity. iOS wasn't built with & before the fix, so the failure there is inferred from the same migration.

A misspelled name in pyproject.toml permissions is still silently ignored.

Reviewing

CHANGELOG.md also tidies a few unrelated entries: it folds the InteractiveViewer entry onto one line, moves the Flutter bump to Improvements, and removes stray blank lines.

Summary by Sourcery

Harden and comprehensively test platform-specific flet build settings and generated project files.

Bug Fixes:

  • Fix iOS export option generation so XML-special characters are escaped and plist values retain numeric and nested types.
  • Fix macOS builds for product or artifact names containing ampersands by using stable scheme buildable names.
  • Allow the biometric permission bundle in the CLI and share permission definitions with documentation generation.

Enhancements:

  • Refactor build setting resolution into platform-specific helpers for Android, iOS, and macOS, with explicit precedence and validation.
  • Require custom templates to read iOS export options from the private cookiecutter options context.
  • Expand Android, iOS, and macOS build-setting coverage with focused template and configuration tests.

Documentation:

  • Document integer and floating-point iOS export option values and arrays containing supported plist types.

Tests:

  • Add comprehensive tests for generated Android manifests and Gradle settings, iOS plist, signing, export options, schemes, and macOS entitlements and project files.

Chores:

  • Tidy unrelated changelog formatting and entry placement.

@sourcery-ai

sourcery-ai Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Sorry @ndonkoHenri, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 13 hours and 22 minutes by commenting @sourcery-ai review. Upgrade to get a review now.

@ndonkoHenri
ndonkoHenri added this pull request to stack #7037 November 2, 2026 00:02
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Deploying flet-website-v2 with  Cloudflare Pages  Cloudflare Pages

Latest commit: 31a9a5f
Status: ✅  Deploy successful!
Preview URL: https://28804c6d.flet-website-v2.pages.dev
Branch Preview URL: https://test-android-build-settings.flet-website-v2.pages.dev

View logs

… methods

Permissions, features, meta-data, providers, Gradle properties and
ProGuard rules were resolved inline in setup_template_data, and the
signing environment and extract_packages inside the methods that run the
build, so none of them could be tested without running a build. Each is
now a get_android_*() method with the same logic and messages; the
rationale comments became their docstrings.
Cover defaults, permission bundles, project settings, CLI options,
validation errors and the rendered AndroidManifest.xml, gradle.properties,
proguard-rules.pro, build.gradle.kts and launcher background for
permissions, features, meta-data, providers, Gradle properties, ProGuard
rules, SDK versions, ABIs, signing, extract_packages and the adaptive
icon background.
Cover the Info.plist settings and template, the Podfile's permission macros, signing and export settings, and the signing values in project.pbxproj and exportOptions.plist. Templates are rendered from a context processed by cookiecutter, like a real build.
exportOptions.plist wrote values unescaped, so thinning = "<none>" made an invalid plist, and the options passed through cookiecutter, which turned numbers into strings and rendered {{ }} in values. The options now reach the template through _options and are escaped, and options that aren't a table or that a plist can't hold fail the build.
Move the bundles to a module constant, so the --permissions choices and the docs read the same list as the build.
Flutter's Swift Package Manager migration copies the scheme's BuildableName back unescaped, which made the scheme invalid XML. The scheme templates now use a fixed name, which nothing in the build reads.
@ndonkoHenri
ndonkoHenri force-pushed the test/android-build-settings branch from 4042bad to 31a9a5f Compare November 2, 2026 00:46

This branch has not been deployed

No deployments
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.

1 participant