You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

无Mac环境下使用Codemagic构建Flutter iOS应用遭遇ARCHIVE FAILED错误求助

Fixing iOS Archive Failures on Codemagic for Flutter Apps

Hey there, let's break down your iOS build issues step by step and get that archive working:

1. Resolve Deployment Target Version Warnings

Your logs show warnings about the IPHONEOS_DEPLOYMENT_TARGET being set to 8.0, but the supported range for your build environment is 9.0 to 14.5.99. These warnings can cause downstream issues, so let's fix them first:

  • Open your Flutter project's ios/Podfile
  • Update the platform target line at the top to at least 9.0:
    platform :ios, '9.0'
    
  • To ensure all pods follow this target (since some might override it), add this post-install hook at the end of the Podfile:
    post_install do |installer|
      installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
          config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
        end
      end
    end
    
  • Commit these changes and trigger a new Codemagic build.

2. Fix the Core Bitcode Bundle Error (ARCHIVE FAILED)

The main failure comes from Xcode needing full bitcode for archiving, but the pre-built Flutter.framework from Flutter 2.2.1 doesn't include it. You have two straightforward fixes:

Option A: Disable Bitcode (Quickest Solution)

Bitcode isn't mandatory for most distribution scenarios, so disabling it will resolve the error immediately:

  • Add a script step in your Codemagic workflow (before the build phase) to update your Xcode project settings:
    sed -i '' 's/ENABLE_BITCODE = YES;/ENABLE_BITCODE = NO;/g' ios/Runner.xcodeproj/project.pbxproj
    
  • If you can access a Mac temporarily (or use a web-based Xcode tool), you can also edit this directly:
    1. Open ios/Runner.xcodeproj in Xcode
    2. Select the Runner target, go to Build Settings
    3. Search for "Bitcode" and set Enable Bitcode to NO
    4. Commit the change and push to your repo, then re-run the Codemagic build.

Option B: Upgrade Flutter or Build the Engine Locally

If you need bitcode enabled:

  • Upgrade to a newer Flutter version (later releases include full bitcode in their iOS framework builds)
  • Or, build the Flutter engine locally with bitcode enabled and use that custom build in Codemagic (this is more advanced, so Option A is recommended for most cases)

After applying these fixes, your Codemagic build should successfully archive your iOS app.

内容的提问来源于stack exchange,提问作者Frank Schneider

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.29 19:32:35