【问题标题】:AppCenter failed to get module and shows error 65AppCenter 获取模块失败并显示错误 65
【发布时间】:2023-03-18 17:51:01
【问题描述】:

我正在将 Swift 与 CocoaPods 一起使用,并尝试在 AppCenter 中构建它。

我一直收到这个失败的日志

    CompileSwift normal arm64 (in target 'Wundercast' from project 'Wundercast')
    cd /Users/runner/runners/2.165.2/work/1/s
    /Applications/Xcode_11.3.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -emit-bc /Users/runner/runners/2.165.2/work/1/s/Wundercast/ViewController.swift /Users/runner/runners/2.165.2/work/1/s/Wundercast/Utils/Colors.swift /Users/runner/runners/2.165.2/work/1/s/Wundercast/AppDelegate.swift /Users/runner/runners/2.165.2/work/1/s/Wundercast/Controllers/ApiController.swift /Users/runner/runners/2.165.2/work/1/s/Wundercast/Utils/Appearance.swift -supplementary-output-file-map /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/supplementaryOutputs-8c8267 -target arm64-apple-ios10.1 -Xllvm -aarch64-use-tbi -enable-objc-interop -sdk /Applications/Xcode_11.3.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk -I /Users/runner/Library/Developer/Xcode/DerivedData/Wundercast-ermhkmlzqioflkgqqzuvbqmqczqy/Build/Intermediates.noindex/ArchiveIntermediates/Wundercast/BuildProductsPath/Release-iphoneos -F /Users/runner/Library/Developer/Xcode/DerivedData/W...
/Users/runner/runners/2.165.2/work/1/s/Wundercast/ViewController.swift:30:8: error: no such module 'RxSwift'
import RxSwift
       ^

** ARCHIVE FAILED **


The following build commands failed:
    CompileSwift normal armv7
    CompileSwiftSources normal armv7 com.apple.xcode.tools.swift.compiler
    CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
    CompileSwift normal arm64
(4 failures)
##[error]Error: /usr/bin/xcodebuild failed with return code: 65

根据之前的研究,我已经为项目配置了xcworkspaceappcenter-post-clone.sh来安装CocoaPods。

Here is the test project link.

我应该怎么做才能解决这个问题?

【问题讨论】:

  • 在启动编译器之前确保您的 CI 作业运行 pod install
  • @Gereon 我用过微软的例子:github.com/microsoft/appcenter/blob/master/sample-build-scripts/…,但还是不行。
  • 在本地构建发布模式后,似乎问题出在本地No such module 'RxSwift'。不是 AppCenter 问题。
  • 您使用的脚本仅安装 cocoapods,但从不运行它。同样:确保在本地和 CI 上开始任何编译之前执行 pod install

标签: ios xcode visual-studio-app-center


【解决方案1】:

在使用a blank project 进行了几次尝试后,它与以下appcenter-post-clone.sh 运行良好

#!/usr/bin/env bash

echo "Uninstalling all CocoaPods versions"
sudo gem uninstall cocoapods --all --executables

COCOAPODS_VER=`sed -n -e 's/^COCOAPODS: \([0-9.]*\)/\1/p' Podfile.lock`

echo "Installing CocoaPods version $COCOAPODS_VER"
sudo gem install cocoapods -v $COCOAPODS_VER

cd $APPCENTER_SOURCE_DIRECTORY
pod install

但是,即使在本地,原始项目仍然在发布模式下失败。至少我现在知道这个问题与 AppCenter 无关,而是与 Xcode 有一些问题。通过将项目文件拖到一个新的 Xcode 项目中,它就像魅力一样工作。

【讨论】:

    猜你喜欢
    • 2019-11-04
    • 1970-01-01
    • 1970-01-01
    • 2016-05-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-02-08
    • 1970-01-01
    相关资源
    最近更新 更多