title: Flutter iOS build on the App Center fails with error: "Invalid Podfile file: Generated.xcconfig must exist
body: <p>I've just set up my app to be built on the App Center, by following the <a href="https://www.rocksolidknowledge.com/articles/using-appcenter-for-flutter-projects" rel="noreferrer">article here</a>.</p>
  
  <p>Although the Android version builds and deploys fine on App Center, I'm getting an error with the iOS build, shown in the excerpt from the build output below:</p>
  
  <pre><code>==============================================================================
  Task         : CocoaPods
  Description  : Install CocoaPods dependencies for Swift and Objective-C Cocoa projects
  Version      : 0.151.1
  Author       : Microsoft Corporation
  Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/package/cocoapods
  ==============================================================================
  [command]/usr/local/lib/ruby/gems/2.6.0/bin/pod --version
  1.9.1
  [command]/usr/local/lib/ruby/gems/2.6.0/bin/pod install --repo-update
  
  [!] Invalid `Podfile` file: Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first.
  
   #  from /Users/runner/runners/2.165.2/work/1/s/bdstories/ios/Podfile:51
   #  -------------------------------------------
   #      unless File.exist?(generated_xcode_build_settings_path)
   &gt;        raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first"
   #      end
   #  -------------------------------------------
  ##[error]The process '/usr/local/lib/ruby/gems/2.6.0/bin/pod' failed with exit code 1
  ##[error]The 'pod' command failed with error: The process '/usr/local/lib/ruby/gems/2.6.0/bin/pod' failed with exit code 1
  ##[section]Finishing: Pod install
  ##[section]Starting: Xcode build (signed)
  </code></pre>
  
  <p>My build script is:</p>
  
  <pre><code>#!/usr/bin/env bash
  # Place this script in project/ios/.
  
  # Fail if any command fails.
  set -e
  
  # Debug log.
  set -x
  cd ..
  
  git clone -b beta https://github.com/flutter/flutter.git
  export PATH=`pwd`/flutter/bin:$PATH
  
  flutter channel beta
  flutter doctor
  
  echo "Installed flutter to `pwd`/flutter"
  
  # Build the app.
  flutter build ios --release --no-codesign
  </code></pre>
  
  <p>I did add the <code>flutter pub get</code> as mentioned in the error, but that didn't make a difference. Also worth noting that the build works fine when I do it in Xcode locally. I can also deploy the built archive to Testflight with no problems. It's just the App Center build process I'm having issues with.</p>
  
  <p>I'm a bit lost now and I can't find any information on how to resolve this. I'm also new to CI/CD, so any help appreciated!</p>
  
  <p><strong>Update</strong></p>
  
  <p>I've also tried adding the following to the script to force App Center to run the same version of Cocoapods as my local machine, but it didn't make a difference to the error.</p>
  
  <pre><code>sudo gem uninstall cocoapods
  sudo gem install cocoapods -v 1.9.1
  pod setup
  </code></pre>