website
website copied to clipboard
Add new step to 'Create flavors of a Flutter app' page
Page URL
https://docs.flutter.dev/deployment/flavors/
Page source
https://github.com/flutter/website/tree/main/src/content/deployment/flavors.md
Describe the problem
Description:
Following the documentation for renaming schemes in the Podfile, an error occurs when building the iOS app. The issue arises after running flutter clean/pub get
and pod install
. The build fails with an error indicating it is unable to load contents of a file list. Manually modifying the ios/Flutter/Debug.xcconfig
file resolves the issue, suggesting a potential missing step in the documentation.
Steps to Reproduce:
- Rename the schemes in the
Podfile
as follows:project 'Runner', { 'Debug-free' => :debug, 'Profile-free' => :release, 'Release-free' => :release, 'Debug-prod' => :debug, 'Profile-prod' => :release, 'Release-prod' => :release, }
- Run
flutter clean
flutter pub get
.. - Run
pod install
. - Attempt to build the iOS app.
Expected Result: The iOS app should build successfully without errors.
Actual Result: The build fails with the following error:
Failed to build iOS app
Error (Xcode): Unable to load contents of file list: '/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Release-prod-input-files.xcfilelist'
Workaround:
Modifying the ios/Flutter/Debug.xcconfig
file manually resolves the issue:
- #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
+ #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug-free.xcconfig"
+ #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug-prod.xcconfig"
#include "Generated.xcconfig"
Environment:
- Flutter version: 3.22.1
- Xcode version: 15.4
- Podfile configuration: as in the sample project
Additional Information:
- Reproducible sample project: new_flavor_test_app
- The error appears before the commit where the manual modification was applied.
Expected fix
It seems that there might be a missing step in the documentation regarding the modification of the xcconfig
files after renaming schemes in the Podfile
. This needs to be confirmed and updated in the documentation to prevent similar issues in the future.
Additional context
No response
I would like to fix this problem.
- [ ] I will try and fix this problem on docs.flutter.dev.