Search code examples
flutterbitcode

Build error: Flutter was built without full bitcode


Getting this error when building the project. All targets and pods have enable bitcode set to yes.

ld: bitcode bundle could not be generated because '...app/ios/Flutter/Flutter.framework/Flutter' was built without full bitcode. All frameworks and dylibs for bitcode must be generated from Xcode Archive or Install build file '...app/ios/Flutter/Flutter.framework/Flutter' for architecture arm64

How can I make sure that the flutter framework is built with full bitcode?

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel unknown, 1.22.4, on macOS 11.2.3 20D91 darwin-x64, locale en-US)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 12.5)
[!] Android Studio (version 4.1)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] Connected device (1 available)

! Doctor found issues in 1 category.

Solution

  • Found the solution, someone in the codemagic slack channel posted it a while ago – that's why you shouldn't use Slack for support: It's not possible to find via web search. Rather use a forum.

    Include config.build_settings['ENABLE_BITCODE'] = 'NO' in the build settings.

    post_install do |installer|
      installer.pods_project.targets.each do |target|
        flutter_additional_ios_build_settings(target)
        target.build_configurations.each do |config|
          config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0'
          config.build_settings['ENABLE_BITCODE'] = 'NO'
        end
      end
    end