当我尝试在Xcode中构建MacOS应用程序时出现错误。
Command MergeSwiftModule failed with a nonzero exit code.
error: umbrella for module 'PDFKit' already covers this directory
umbrella header "PDFKit.h"
^
error: inferred submodules require a module with an umbrella
module * { export * }
我的大多数Swift文件都具有:
import Cocoa
import Quartz
我经常使用PDFKit,所以我猜测这与导入和引用标头有关。该错误发生在Xcode 11.1和11.2上。
我尝试了“干净构建”,但没有成功。 such as this one还有其他线程,似乎暗示这是一个非特定性的间歇性问题。
答案 0 :(得分:3)
在我的情况下,编译错误是由于导入了自定义框架而又导入了PDFKit引起的。我用Categories:
- Internet
- Reading License: GPL-3.0-or-later AuthorName: Abhinav Marwaha SourceCode: https://github.com/abhinavmarwaha/curator IssueTracker: https://github.com/abhinavmarwaha/curator/issues Changelog: https://github.com/abhinavmarwaha/curator/releases Donate: https://www.buymeacoffee.com/abhinavmarwaha Liberapay: abhinavmarwaha Bitcoin: bc1qfmwzy7qp97r9cnh7n9y4yze8t0lt7dyzyhtg07
AutoName: Curator Description: |-
Features:
Read/unread
Bookmark
Zen Reader (Experimental)
Podcast Support
Hold to view the summary of rs feed item
Categories
RepoType: git Repo: https://github.com/abhinavmarwaha/curator
Builds:
- versionName: 0.1.0
versionCode: 1
commit: v0.1.0
output: build/app/outputs/apk/fdroid/release/app-fdroid-release.apk
srclibs:
- flutter@dev
prebuild: sed -i -e 's|git@github.com:|https://github.com/|' pubspec.lock pubspec.yaml
build:
- export PATH=$$flutter$$/bin:$PATH
- flutter config --no-analytics
- flutter build apk --flavor fdroid
MaintainerNotes: |-
Builds will fail when the srclib ref of flutter and the version with which
upstream has been built with differ.
In that case we need to manually give the correct ref to srclib.
AutoUpdateMode: Version v%v UpdateCheckMode: Tags UpdateCheckIgnore: (alpha|beta|rc|RC|dev) CurrentVersion: 0.1.0 CurrentVersionCode: 1
更改了框架代码中的import PDFKit
,这种解决方法解决了Xcode 11.6中的问题。
Xcode 12 beta 3似乎可以更好地工作,并且不需要任何解决方法即可构建现有代码。
答案 1 :(得分:0)
由于错误消息的性质,我从所有文件中删除了所有import Quartz
语句,然后尝试构建。显然,然后由于未知对象而失败。
然后,我恢复了import Quartz
行,并解决了该问题。
这似乎是Xcode中的错误。