当我使用由Nevercode拥有的CodeMagic(https://codemagic.io/)部署我的Flutter应用程序时,我无法自动递增版本号。
我遵循了此页面上描述的步骤:https://developer.nevercode.io/docs/incrementing-ios-app-version。
他们建议使用的脚本是:
DSYM_INFO_PLIST="${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Info.plist"
buildNumber=$NEVERCODE_BUILD_NUMBER
stringLength=${#buildNumber}
if [ $stringLength -ne 0 ]; then
echo "Updating build number to $buildNumber"
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"
if [ -f "$DSYM_INFO_PLIST" ]; then
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $BUILD_NUMBER" "$DSYM_INFO_PLIST"
fi
else
echo "Missing build number, skip updating"
fi
在我将这个脚本添加到Xcode后,我得到了这个错误:
Running pod install... 34.3s
Running Xcode build...
├─Assembling Flutter resources... 6.1s
└─Compiling, linking and signing... 6.9s
Xcode build done. 30.3s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
/Users/macbook/Library/Developer/Xcode/DerivedData/Runner-hdgyskbygbvchfagqudvhwidlraa/Build/Intermediates.noindex/Runner.build/Debug-iphoneos/Runner.build/Script-3590602C2
2484D000061C91A.sh: line 15: syntax error: unexpected end of file
Command /bin/sh failed with exit code 2
Could not build the precompiled application for the device.
有人能够解释一下如何在使用Codemagic部署IOS应用程序时正确增加版本号吗?它应该是在Xcode的构建阶段运行的脚本还是在Codemagic工作流的构建步骤中添加的命令?
理想情况下,当我使用flutter run
运行应用程序时,它不应该增加版本号,但是当我将其部署到App Store Connect时应该增加。
#include "Generated.xcconfig"
。我的是自动生成的podsrunner.release-flavor文件,我找不到并检查它们,所以我为每个flavor创建了新的文件,然后添加了``#include "Generated.xcconfig",然后添加自动生成的文件(
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release-qa.xcconfig"`),最后添加我的特定flavor的环境变量。 - BeniaminoBaggins