flutter / website

Flutter documentation web site
https://docs.flutter.dev
Other
2.74k stars 3.17k forks source link

Add new step to 'Create flavors of a Flutter app' page #10713

Open qwadrox opened 3 weeks ago

qwadrox commented 3 weeks ago

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:

  1. 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,
    }
  2. Run flutter clean flutter pub get..
  3. Run pod install.
  4. 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:

Additional Information:

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.

sfshaza2 commented 3 weeks ago

Thanks for reporting this issue and fix!!