1

I'm a PC developer, building my Flutter application for iOS using cloud CI/CD platforms. My app works perfectly on Android (both emulators and physical devices), confirming the health of my Dart code and plugin usage.

However, I'm consistently hitting a very specific and stubborn build failure on the iOS pipeline of both Codemagic and Bitrise.

The problem manifests as a circular dependency (or timing issue) related to the darwin-podhelper.rb file during the pod install process, which is a core part of Flutter's native iOS build.

Here's the core issue I'm observing across CI/CD platforms:

My standard Flutter iOS/Podfile (generated by flutter create and containing typical plugin setup) includes the line:

require File.expand_path('../Flutter/ephemeral/.symlinks/flutter/darwin-podhelper.rb', __FILE__)

This darwin-podhelper.rb helper file is essential for Flutter to correctly integrate plugins into the native iOS project via CocoaPods. However, in the CI/CD environment:

The flutter build ios command (or `flutter build ios --config-only`, which is designed to generate this file) internally runs pod install as part of its process.
This internal pod install attempts to process the Podfile, which immediately tries to require `darwin-podhelper.rb`.
But the `darwin-podhelper.rb` file does not exist yet because the flutter build ios command (that's supposed to create it) hasn't completed its work due to this very requirement!

This creates a vicious loop, leading to the build failing because the file is "not found" when required, even though its generation is part of the command's job. Key Error Log (from both platforms, during flutter build iOS's internal pod install):

[!] Invalid `Podfile` file: cannot load such file -- /Users/builder/clone/ios/Flutter/ephemeral/.symlinks/flutter/darwin-podhelper.rb.

from /Users/builder/clone/ios/Podfile:6
-------------------------------------------
✅ Required to load Flutter helper methods like `flutter_install_ios_plugin_pods` require File.expand_path('../Flutter/ephemeral/.symlinks/flutter/darwin-podhelper.rb',
__FILE__)
-------------------------------------------
Error running pod install
3
  • Flutter doesn't really work. THere's a reason there is not one commercial multi-platform Flutter app. It is far, far, far cheaper to just develop two simple native apps. Commented May 31 at 1:31
  • @Fattie, what do you mean by "Flutter doesn't really work"? Commented May 31 at 2:09
  • @Fattie, thank you for the response, but there seems to be a lot of Flutter developers out there and a lot of Flutter applications. I know it is supposed to be a big part of the CI/CD business too. That is what is baffling me with my issue. I cannot believe it is the normal situation. Commented May 31 at 3:21

1 Answer 1

0

Hard to verify without a code which reproduces the issue, but this might work:

# Clean any stale/generated files
flutter clean

# Fetch Flutter packages (generates ephemeral files)
flutter pub get

# Generate iOS configs and ephemeral symlinks including darwin-podhelper.rb
flutter build ios --config-only

# Go into ios directory
cd ios

# Install CocoaPods dependencies now that helper file exists
pod install

# Go back to root and build full iOS app
cd ..

flutter build ios --release
Sign up to request clarification or add additional context in comments.

2 Comments

Viktor, thank you for your response. Forgive me for being new to Codemagic, but where would I run these commands? From the Podfile? From Codemagic.yaml? Or do I use the Workflow and add a pre-test script? Thank you for your time.
I don't know it on Codemagic; on Bitrise you can just use a Script step.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.