【发布时间】:2020-06-30 03:13:57
【问题描述】:
我刚刚通过article here 将我的应用设置为在应用中心上构建。
虽然 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 的新手,因此感谢您的帮助!
更新
我还尝试将以下内容添加到脚本中,以强制 App Center 运行与本地计算机相同版本的 Cocoapods,但这对错误没有影响。
sudo gem uninstall cocoapods
sudo gem install cocoapods -v 1.9.1
pod setup
【问题讨论】:
-
您有没有为此提出解决方案?我遇到了完全相同的问题,我尝试了所有相同的事情
-
还没有,很遗憾。不过,我会在接下来的几天里再次查看它。应用中心的支持人员说他们会传递信息,但由于没有官方支持,他们不能承诺任何事情。
标签: ios flutter visual-studio-app-center