Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Multiple commands produce '/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/Flutter.framework #20685
When I want to debug the application in MacOs environment, it throw such error:
Multiple commands produce '/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/Flutter.framework
Mac 10.14 Beta
How to fix it? Thanks a lot
This issue affects all Flutter projects built using Xcode 10 that have a dependency on CocoaPods -- typically this means those that rely on plugins.
There are two workarounds:
When plugins are in use, there are two competing build actions that copy Flutter.framework into the build application Frameworks directory:
Item (1) is there to ensure the framework is copied into the built app in the case where there are no plugins (and therefore no CocoaPods integration in the Xcode project). Item (2) is there because Flutter's podspec declares
The immediate fix is for us to find a way to automatically opt back in to the legacy build fix until a longer-term better solution is in place. Previous betas supported
The simplest option would be to eliminate Flutter.framework from the Embed Frameworks step above and always rely on pod install, even in the case where there are no plugin dependencies. We'd need to update Flutter tool to automatically edit existing projects to remove Flutter.framework from the Embed Frameworks step.
pro: simpler code. con: makes cocoapods a required install step for Flutter development, first run involves a huge and very slow download of their repo.
A slightly nicer option would be for us to automatically detect whether the project uses plugins or not, and edit the Xcode project to check for and remove Flutter.framework from the Embed Frameworks step automatically if plugins are in use or add it if not.
pro: better user experience. con: more complex code.
Either way, we need some mechanism to automatically edit the project.pbxproj file and remove the framework from the embed frameworks build step. Supporting adding it back in isn't much incremental work and results in a better experience.
We can also leverage the CocoaPods installation option disable_input_output_paths, which removes the input and output files from the [CP] Emded Pods Framework build phase. That installation option was added because the new Xcode build system failed to run the script even when the input files were touched. See https://www.ralfebert.de/ios/blog/cocoapods-clean-input-output-files.
If you're still seeing this error, you will need to migrate your Xcode project:
See https://github.com/flutter/flutter/blob/master/examples/platform_view/ios/Podfile for example.
Hopefully your cloud pipeline should run
If you are still seeing the error, you can edit ios/Runner.xcodeproj/project.pbxproj to remove the output file manually. Please be careful doing this! The Xcode project file does not take kindly to corruption.