Skip to content

bug: macOS build fails on Xcode 27 — generated project uses outdated MACOSX_DEPLOYMENT_TARGET (11.0/10.15, Xcode 27 requires 12.0+) #6874

Closed

Description

@perna-python

Duplicate Check

Describe the bug

A Flet macOS application fails to build with Xcode 27 because the generated Flutter/macOS project under build/flutter/macos contains MACOSX_DEPLOYMENT_TARGET values below the minimum Xcode 27 supports (12.0): 11.0 in the Xcode project (Runner, Flutter Assemble) and 10.15 in the generated CocoaPods project (Pods-Runner, FlutterMacOS). The app's own source repo has no native macos/ directory — the whole project, Podfile included, is generated by flet build macos. There is also an unrelated informational warning about CocoaPods vs Swift Package Manager integration; it is not the cause of the failure.

Code sample

# main.py
import flet as ft

def main(page: ft.Page):
    page.add(ft.Text("Hello, Flet on macOS!"))

ft.app(main)
# pyproject.toml
[project]
name = "test-flet-macos"
version = "1.0.0"
requires-python = ">=3.13"
dependencies = ["flet[cli,desktop]>=1.0.0"]

[tool.flet]
org = "com.example"
product = "Test Flet macOS"

To reproduce

  1. Create the two files above in an empty folder.
  2. On an Apple Silicon Mac running macOS 27 with Xcode 27, run:
    uv run flet build macos --yes --verbose
  3. The Flutter project is generated under build/flutter/macos.
  4. Xcode fails with the deployment-target error described above.

Expected behavior

flet build macos should generate a macOS project compatible with the minimum deployment target of the installed Xcode/Flutter toolchain (12.0 for Xcode 27).

Screenshots / Videos

Captures

[Upload media here]

Operating System

macOS

Operating system details

macOS 27.0, Apple Silicon (arm64), Xcode 27.0

Flet version

1.0.1

Regression

No, it isn't

Suggestions

Flutter 3.47+ already ships an automatic MacOSDeploymentTargetMigration that rewrites old deployment-target values (10.11/10.13/10.14/10.15/11.0) to 12.0 in both the Podfile and project.pbxproj the first time flutter build macos runs. Could Flet bump its bundled/minimum supported Flutter SDK to 3.47+? That would fix this at the source rather than requiring template patches that go stale at the next Xcode bump.

Manual workaround in the meantime:
cd build/flutter/macos
pod deintegrate
rm -f Podfile Podfile.lock
rm -rf Pods
sed -i '' 's/MACOSX_DEPLOYMENT_TARGET = 11.0;/MACOSX_DEPLOYMENT_TARGET = 12.0;/g' Runner.xcodeproj/project.pbxproj

Logs

Logs
(.venv) <user>@Mac issue % flet build macos --verbose
[23:33:04] Run subprocess: ['/Users/<user>/flutter/3.44.8/bin/flutter', '--version',
           '--no-version-check', '--suppress-analytics']
[23:33:05] Flutter executable: /Users/<user>/flutter/3.44.8/bin/flutter
           Dart executable: /Users/<user>/flutter/3.44.8/bin/dart
           Created app shell ✅
           Run subprocess: ['/Users/<user>/flutter/3.44.8/bin/dart', 'run',
           '--suppress-analytics', 'serious_python:main', 'package',
           '/Users/<user>/issue', '--platform', 'Darwin', '--python-version',
           '3.14', '-r', 'flet >=1.0.0', '--exclude', 'build', '--compile-app',
           '--compile-packages', '--cleanup-packages']
[23:33:07] Running build hooks...Running build hooks...Running package command
           Python 3.14 (CPython 3.14.7, Pyodide 314.0.7)
           Extra PyPi indexes: [https://pypi.flet.dev]
           Created temp directory:
           /var/folders/.../T/serious_python_tempG7yoU7
           Copying Python app from /Users/<user>/issue to a temp directory
[23:33:08] Compiling Python sources in a temp directory
           Extracting Python distributive
[23:33:09] Python distributive extracted to
           /Users/<user>/issue/build/flutter/build/build_python_3.14.7
           Running:
           /Users/<user>/issue/build/flutter/build/build_python_3.14.7/python/bin
           /python3 -m compileall -b
           /var/folders/.../T/serious_python_tempG7yoU7
[23:33:12] Configured Darwin/arm64 platform with sitecustomize.py
           Installing [flet[cli,desktop] >=1.0.0] with pip command to
           /Users/<user>/issue/build/site-packages/arm64
           Running:
           /Users/<user>/issue/build/flutter/build/build_python_3.14.7/python/bin
           /python3 -m pip install --upgrade --disable-pip-version-check --timeout 30
           --retries 3 --no-input --extra-index-url https://pypi.flet.dev --target
           /Users/<user>/issue/build/site-packages/arm64 flet[cli,desktop]
           >=1.0.0
[23:33:21] Compiling app packages at
           /Users/<user>/issue/build/site-packages/arm64
           Running:
           /Users/<user>/issue/build/flutter/build/build_python_3.14.7/python/bin
           /python3 -m compileall -b
           /Users/<user>/issue/build/site-packages/arm64
[23:33:23] Cleanup installed packages
           Configured Darwin/x86_64 platform with sitecustomize.py
           Installing [flet[cli,desktop] >=1.0.0] with pip command to
           /Users/<user>/issue/build/site-packages/x86_64
           Running:
           /Users/<user>/issue/build/flutter/build/build_python_3.14.7/python/bin
           /python3 -m pip install --upgrade --disable-pip-version-check --timeout 30
           --retries 3 --no-input --extra-index-url https://pypi.flet.dev --target
           /Users/<user>/issue/build/site-packages/x86_64 flet[cli,desktop]
           >=1.0.0
[23:33:32] Compiling app packages at
           /Users/<user>/issue/build/site-packages/x86_64
           Running:
           /Users/<user>/issue/build/flutter/build/build_python_3.14.7/python/bin
           /python3 -m compileall -b
           /Users/<user>/issue/build/site-packages/x86_64
[23:33:34] Cleanup installed packages
           Merging macOS arm64 and x86_64 site-packages
[23:33:35] Merging completed successfully.
           Staging unpacked app to /Users/<user>/issue/build/python-app
[23:33:37] SPM: staging macos via
           /Users/<user>/.pub-cache/hosted/pub.dev/serious_python_darwin-4.7.1/darwin/pr
           epare_spm.sh
[23:33:45] SPM: SP_NATIVE_SET=68e001c83d491f5c1ae318f7a2923b9bf617c9bd57b1839c4194628ff36e97a7
           -> /Users/<user>/issue/build/.serious_python_spm_key
           Deleting temp directory
           Packaged Python app ✅
           Run subprocess: ['/Users/<user>/flutter/3.44.8/bin/flutter', 'build',
           'macos', '--build-name', '1.0.0', '--no-version-check', '--suppress-analytics']
[23:33:46] Resolving dependencies...
           Downloading packages...
             code_assets 1.2.1 (2.1.0 available)
             dbus 0.7.12 (0.8.0 available)
             device_info_plus 12.4.0 (13.2.0 available)
             device_info_plus_platform_interface 7.0.3 (8.1.0 available)
             equatable 2.1.0 (3.0.0 available)
             file_picker 11.0.3 (13.1.0 available)
           ! flet 1.0.1 (overridden)
             flutter_lints 2.0.3 (6.0.0 available)
             hooks 2.0.2 (2.2.0 available)
             intl 0.20.2 (0.20.3 available)
           ! jni 1.0.0 (overridden) (1.0.3 available)
             lints 2.1.1 (6.1.0 available)
             material_color_utilities 0.13.0 (0.13.1 available)
             meta 1.18.0 (1.19.0 available)
             objective_c 9.5.0 (9.6.0 available)
             package_config 2.2.0 (3.0.0 available)
             package_info_plus 9.0.1 (10.2.1 available)
             package_info_plus_platform_interface 3.2.1 (4.1.0 available)
             petitparser 6.1.0 (7.0.2 available)
             record_use 0.6.0 (1.1.1 available)
           ! screen_retriever 0.2.1 (overridden) (0.2.2 available)
             share_plus 12.0.2 (13.3.0 available)
             share_plus_platform_interface 6.1.0 (7.2.0 available)
             shimmer 3.0.0 (4.0.0 available)
             toml 0.15.0 (0.18.0 available)
             vector_math 2.2.0 (2.4.3 available)
             wakelock_plus 1.5.2 (1.8.0 available)
             win32 5.15.0 (6.4.0 available)
             win32_registry 2.1.0 (3.0.3 available)
             xml 6.5.0 (7.0.1 available)
           Got dependencies!
           29 packages have newer versions incompatible with dependency constraints.
           Try `flutter pub outdated` for more information.
           Updating project for Xcode compatibility.
           Upgrading Runner.xcscheme
[23:33:55] Adding Swift Package Manager integration...                         7,2s
           .gitignore does not ignore Swift Package Manager build directories, updating.
           Upgrading Runner.xcscheme
           All plugins found for macos are Swift Packages, but your project still has
           CocoaPods integration. Your project uses a non-standard Podfile and will need to be
           migrated to Swift Package Manager manually. Some steps you may need to complete
           include:
             * In the macos/ directory run "pod deintegrate"
             * Transition any Pod dependencies to Swift Package equivalents. See
           https://developer.apple.com/documentation/xcode/adding-package-dependencies-to-your
           -app
             * Transition any custom logic
             * Remove the include to "Pods/Target Support
           Files/Pods-Runner/Pods-Runner.debug.xcconfig" in your
           macos/Flutter/Flutter-Debug.xcconfig
             * Remove the include to "Pods/Target Support
           Files/Pods-Runner/Pods-Runner.release.xcconfig" in your
           macos/Flutter/Flutter-Release.xcconfig

           Removing CocoaPods integration will improve the project's build time.
[23:33:58] Running pod install...                                             416ms
[23:34:07] Building macOS application...
           /Users/<user>/issue/build/flutter/macos/Pods/Pods.xcodeproj: error:
           The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 11.0, but the
           range of supported deployment target versions is 12.0 to 27.0.x. (in target
           'Pods-Runner' from project 'Pods')
           /Users/<user>/issue/build/flutter/macos/Runner.xcodeproj: error: The
           macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 11.0, but the range of
           supported deployment target versions is 12.0 to 27.0.x. (in target 'Flutter
           Assemble' from project 'Runner')
           warning: Run script build phase 'Run Script' will be run during every build because
           it does not specify any outputs. To address this issue, either add output
           dependencies to the script phase, or configure it to run in every build by
           unchecking "Based on dependency analysis" in the script phase. (in target 'Flutter
           Assemble' from project 'Runner')
           /Users/<user>/issue/build/flutter/macos/Pods/Pods.xcodeproj: error:
           The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.15, but the
           range of supported deployment target versions is 12.0 to 27.0.x. (in target
           'FlutterMacOS' from project 'Pods')
           /Users/<user>/issue/build/flutter/macos/Runner.xcodeproj: error: The
           macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 11.0, but the range of
           supported deployment target versions is 12.0 to 27.0.x. (in target 'Runner' from
           project 'Runner')
           ** BUILD FAILED **

           Build process failed
           Run subprocess: ['/Users/<user>/flutter/3.44.8/bin/flutter', 'doctor',
           '--no-version-check', '--suppress-analytics']
[23:34:13] Doctor summary (to see all details, run flutter doctor -v):
           [!] Flutter (Channel stable, 3.44.8, on macOS 27.0 26A428 darwin-arm64, locale
           it-IT)
               ! The flutter binary is not on your path. Consider adding
           /Users/<user>/flutter/3.44.8/bin to your path.
               ! The dart binary is not on your path. Consider adding
           /Users/<user>/flutter/3.44.8/bin to your path.
           [✗] Android toolchain - develop for Android devices
               ✗ Unable to locate Android SDK.
           [!] Xcode - develop for iOS and macOS (Xcode 27.0)
               ! iOS 27.0 Simulator not installed; this may be necessary for iOS and macOS
           development.
           [✓] Chrome - develop for the web
           [✓] Connected device (2 available)
           [✓] Network resources

           ! Doctor found issues in 3 categories.

╭────────────────────────────────────────────────────────────────────────────────────────────╮
│ Error building Flet app - see the log of failed command above.                             │
╰────────────────────────────────────────────────────────────────────────────────────────────╯

Additional details

The source repo contains no macos/ directory (no Podfile, Podfile.lock, *.xcconfig, Runner.xcodeproj) — everything under build/flutter/macos is generated by the Flet build process.

Activity

  1. FeodorFitsner commented on Sep 23, 2026

    @FeodorFitsner
    Contributor

    Good catch, thank you!

  2. NiTRoeSE commented on Oct 7, 2026

    @NiTRoeSE

    Manual workaround in the meantime:
    cd build/flutter/macos
    pod deintegrate
    rm -f Podfile Podfile.lock
    rm -rf Pods
    sed -i '' 's/MACOSX_DEPLOYMENT_TARGET = 11.0;/MACOSX_DEPLOYMENT_TARGET = 12.0;/g' Runner.xcodeproj/project.pbxproj

    Hi i have the same problem and can't build at the moment.
    What i have to do after applying the manual workaround ? (Running build again did fail again)
    Pls help, need to deploy a update for my app.

    Thanks in advanced!

  3. perna-python commented on Oct 8, 2026

    @perna-python
    Author

    @NiTRoeSE I think the workaround needs to be applied to the already generated project. On a fresh project, there is also a separate jni dependency issue that can appear first and hide the macOS/Xcode deployment-target error.

    The sequence that works for me is:

    1. Run the first build

    It may fail, but it generates build/flutter/macOS:

    flet build macOS

    2. Apply the deployment-target workaround to the generated project

    cd build/flutter/macOS
    
    pod deintegrate
    rm -f Podfile Podfile.lock
    rm -rf Pods
    
    sed -i '' 's/MACOSX_DEPLOYMENT_TARGET = 11.0;/MACOSX_DEPLOYMENT_TARGET = 12.0;/g' Runner.xcodeproj/project.pbxproj
    sed -i '' 's/MACOSX_DEPLOYMENT_TARGET=1[01]\.[0-9]/MACOSX_DEPLOYMENT_TARGET=12.0/g' Flutter/*.xcconfig
    
    cd ../../..

    3. Add the jni override to pyproject.toml

    The current Flet template can resolve jni_flutter to a version requiring jni ^1.1.0, while the template overrides jni to 1.0.0. This is the same dependency incompatibility already reported in [#6919](#6919).

    Add:

    [tool.flet.flutter.pubspec.dependency_overrides]
    jni = "^1.1.0"

    This is important because otherwise the build can fail at the Dart compilation stage before reaching the macOS/Xcode deployment-target error.

    4. Rebuild without deleting build/flutter

    flet build macOS

    The important point is not to delete build/flutter between steps 2 and 4, otherwise Flet regenerates the macOS project and the original deployment targets are restored.

    If the build still fails, the last error in the log helps distinguish the two problems:

    • JniVersionCheck → the jni override is missing or has not been applied.
    • MACOSX_DEPLOYMENT_TARGET → the macOS deployment-target workaround was not preserved, usually because the generated project/Pods were recreated.

    So, in my case, the reliable workaround is: generate the project first → modify the generated macOS project → add the jni override → rebuild without regenerating it.

  4. ndonkoHenri commented on Nov 5, 2026

    @ndonkoHenri
    Contributor

    Fixed in Flet 1.1.0 by #6914 (how to upgrade).

    flet build macos and flet build ipa/ios-simulator now work with Xcode 27 without the manual workaround. A build folder left over from a failed build is fine: it's regenerated on the next build.

  5. moved this from 🔖 Ready to ✅ Done in Flet Developmenton Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingplatform: macOSSpecific to macOS

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions