我已经按照article here将我的应用设置为要在App Center上构建。
尽管Android版本可以在App Center上很好地构建和部署,但是我在iOS版本上遇到了错误,如下面的版本输出中的摘录所示:
==============================================================================
Task : CocoaPods
Description : Install CocoaPods dependencies for Swift and Objective-C Cocoa projects
Version : 0.151.1
Author : Microsoft Corporation
Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/package/cocoapods
==============================================================================
[command]/usr/local/lib/ruby/gems/2.6.0/bin/pod --version
1.9.1
[command]/usr/local/lib/ruby/gems/2.6.0/bin/pod install --repo-update
[!] Invalid `Podfile` file: Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first.
# from /Users/runner/runners/2.165.2/work/1/s/bdstories/ios/Podfile:51
# -------------------------------------------
# unless File.exist?(generated_xcode_build_settings_path)
> raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first"
# end
# -------------------------------------------
##[error]The process '/usr/local/lib/ruby/gems/2.6.0/bin/pod' failed with exit code 1
##[error]The 'pod' command failed with error: The process '/usr/local/lib/ruby/gems/2.6.0/bin/pod' failed with exit code 1
##[section]Finishing: Pod install
##[section]Starting: Xcode build (signed)
我的构建脚本是:
#!/usr/bin/env bash
# Place this script in project/ios/.
# Fail if any command fails.
set -e
# Debug log.
set -x
cd ..
git clone -b beta https://github.com/flutter/flutter.git
export PATH=`pwd`/flutter/bin:$PATH
flutter channel beta
flutter doctor
echo "Installed flutter to `pwd`/flutter"
# Build the app.
flutter build ios --release --no-codesign
我确实添加了错误中提到的flutter pub get
,但这并没有什么不同。另外值得注意的是,当我在Xcode本地进行构建时,该构建工作正常。我也可以毫无问题地将生成的存档部署到Testflight。这只是我遇到问题的App Center构建过程。
我现在有点迷茫,找不到有关如何解决此问题的任何信息。我还是CI / CD的新手,所以感谢您的帮助!
更新
似乎ios / Flutter / Generated.xcconfig中的文件在.gitignore中列出。因此,我将其从列表中删除作为测试。但是,即使构建超过了第一个错误,我也遇到了另一个错误:
Invalid `Podfile` file: Not a directory @ rb_file_s_stat - /Users/runner/runners/2.165.2/work/1/s/myproject/ios/Flutter/Generated.xcconfig/C:\Users\Tarique\Development\SDK\flutter\bin\cache\artifacts\engine\ios/Flutter.framework.
[好像Generated.xcconfig
正在查看我自己的文件夹结构(但是,在Mac上类似,但是我注意到Flutter.framework
在项目的“ ios / Flutter”文件夹中)。
我现在回过头来排除此生成的文件,因为它显然是在本地构建过程中创建的,而不是在App Center上创建的。情节变厚了!
尝试进入IOS文件夹,然后按pod install
或pod update
在终端中