Open lukehutch opened 1 week ago
No, Info.plist doesn't change.
I meant, is CFBundleShortVersionString
in the generated app literally $(FLUTTER_BUILD_NAME)
(incorrect) or is it 0.0.1
(correct)? If it's the FLUTTER_BUILD_NAME variable name, this error has to do with your Xcode setup and xcconfig, and wouldn't be related to the Xcode Cloud setup--it's something you should fix in your project.
@jmagman is this what you are suggesting I do?:
plutil -convert xml1 ./build/ios/iphoneos/Runner.app/AppFrameworkInfo.plist
plutil -convert xml1 ./build/ios/iphoneos/Runner.app/Info.plist
Then examining these two files, I can see that the variable names are replaced with the correct version strings in Info.plist
, but not in AppFrameworkInfo.plist
.
I tried taking the keys and values out of AppFrameworkInfo.plist
, assuming that they only needed to be in Info.plist
, but then I get a build error.
I found the issue: I had assumed that both Runner/Info.plist
and Flutter/AppFrameworkInfo.plist
should contain:
<key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
However I noticed that when I create a new Flutter project, Flutter/AppFrameworkInfo.plist
has the value 1.0
in place of both of these variables. I put the 1.0
values back, and now Xcode Cloud can build the app.
I don't understand what these 1.0
values in Flutter/AppFrameworkInfo.plist
are used for though -- are they just placeholders, given that they are not updated based on the Flutter build version strings? They have to be present, or the build fails, but they are not updated automatically from the Flutter build number, and apparently the FLUTTER_*
variables are not expanded in AppFrameworkInfo.plist
.
Should Flutter be manually keeping these version numbers up to date in AppFrameworkInfo.plist
? Obviously it doesn't make sense to do it manually. Are these version numbers even used anywhere?
Page URL
https://docs.flutter.dev/deployment/cd
Describe the problem
I added
ci_post_clone.sh
(the script by @Diizzayy) to my Flutter project, and set up the Xcode cloud deployment workflow as shown in the Flutter docs at the above URL.I get the following CI build errors:
However
flutter run
works locally. So there seems to be some step missing from theci_post_clone.sh
script (something that is run byflutter run
but not by the script, to replace these variables with the actual correct values before the Xcode Cloud build is started).After a local run of
flutter run
, myGenerated.xcconfig
(which is not checked into git) does include the following (these numbers are correctly picked up frompubspec.yaml
when I runflutter run
):Runner/Info.plist
andFlutter/AppFrameworkInfo.plist
both contain:My
Runner.xcodeproj/project.pbxproj
file contains the following for each target:@jmagman asked me in #7259 to file this separate bug report, and include:
Q: when you
flutter run
locally can you see the right values in the app's Info.plist?A: No,
Info.plist
doesn't change.Q: are you using flavors?
A: I don't even know what flavors are, so probably no.
Expected fix
As far as I can tell, Xcode Cloud is simply not generating
Generated.xcconfig
, so maybe it is not callingflutter build
, but rather is relying only on Xcode to build the ipa?I tried adding this to the end of
ci_post_clone.sh
, but it does not seem to have fixed the problem: