1

我正在尝试为自己制作一个 Carthage 包,但是error: no such module当我真正让 Carthage 构建包时,我遇到了问题。当我从 Xcode 中的工作区构建时,一切都很好。当我从命令行运行 xcodebuild 时,一切都在那里构建。

但是,当我这样做carthage update时,依赖框架会成功构建,但使用该框架的框架会因上述错误而失败,error: no such module.

所以我想我显然在依赖框架中设置了错误。

我应该在依赖框架的构建设置中寻找任何地方吗?

我可以转到我的工作区目录并运行:

cd directoryThatContainsWorkspace && xcodebuild -scheme TestZipArchive -configuration Release

它工作得很好

但是当我尝试运行相同的命令时,Carthage/Checkout/TestZipArchive我得到模块未找到错误。

这个错误对我来说很有意义,因为当我直接从目录执行此操作时,我可能没有指定搜索路径。然而,再一次,carthage update或者carthage build从 Cartfile 的位置也以同样的方式失败。

迦太基错误如下:

** BUILD FAILED **


The following build commands failed:
        CompileSwift normal x86_64 /Users/aventurella/github/testing/Carthage/Checkouts/TestZipArchive/TestZipArchive/TestZipArchive/Frontend.swift
        CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
(2 failures)
/Users/aventurella/github/testing/Carthage/Checkouts/TestZipArchive/TestZipArchive/TestZipArchive/Frontend.swift:10:8: error: no such module 'ZipArchive'
A shell task failed with exit code 65:
** BUILD FAILED **


The following build commands failed:
        CompileSwift normal x86_64 /Users/aventurella/github/testing/Carthage/Checkouts/TestZipArchive/TestZipArchive/TestZipArchive/Frontend.swift
        CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
(2 failures)

购物车文件

github "aventurella/ZipArchive" "new"

# original forked version has issues as well
# github "ZipArchive/ZipArchive" "master"

更新 1

好的,除了 iOS 目标之外,我还添加了一个 Mac 目标,并$(inherited)Framework Search PathsBuild Settings 中删除。事实上,ZipArchive 和 TestZipArchive 的框架搜索路径都是空的。

你猜怎么着......它现在构建......所以我不知道是添加了mac目标还是$(inherited)从框架搜索路径中删除了。是时候用 git 回到过去并找出答案了。

更新 2

我认为它正在$(inherited)Framework Search Paths. 刚刚将没有 Mac 目标的构建排入队列,它又可以工作了。

4

0 回答 0