Frank Perez

Frank Perez

Keep in touch

An experienced Web Developer with years of experience in design, programming and server administration.

Blog

Overview

© 2024 by Frank Perez.

Troubleshooting Xcode 15 Build Issues in Flutter Projects

Updating to Xcode 15 brought a few hurdles in my Flutter project, especially since I was using an older version of CocoaPods, below version 13. Here's a breakdown of how I navigated through these issues and got my project back on track.

Step 1: Update Podfile (Flutter / Xcode 15)

Update your Podfile with the following snippet:

post_install do |installer|
  installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
          xcconfig_path = config.base_configuration_reference.real_path
          xcconfig = File.read(xcconfig_path)
          xcconfig_mod = xcconfig.gsub(/DT_TOOLCHAIN_DIR/, "TOOLCHAIN_DIR")
          File.open(xcconfig_path, "w") { |file| file << xcconfig_mod }
      end
  end
  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'] = '13.0'
      end
  end
end

Step 2: Update Build Phases

  1. Open Xcode
  2. Click "Runner" in the project navigator
  3. Navigate to Targets (Runner in the sidebar)
  4. Click on Build Phases (found in the top bar)
  5. Move "Embed App Extension" above the Run Script step

Step 3: Run Flutter Clean

Once the above changes are done, clean your project with the following command:

flutter clean

You should now be able to successfully build and run your project.