为什么我从命令行找不到xcodebuild致命错误模块映射文件 [英] Why do i get xcodebuild fatal error module map file not found from command line

查看:435
本文介绍了为什么我从命令行找不到xcodebuild致命错误模块映射文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用SPM(而不使用可可足类)的项目。
它可以编译并正常运行。



我可以从命令行运行SwiftLint自动更正,它也可以工作。



但是,当我尝试对其运行爵士乐时,出现此错误:


致命错误:模块映射文件
'/ Users / Alex / Library / Developer / Xcode / DerivedData / Answers-akfeigwudbzjrkewvufnejnpluej / SourcePackages / checkouts / realm-cocoa / buil
d / GeneratedModuleMaps / iphoneos / RealmCore.modulemap'not found


我经历了许多修复,解决了类似问题:我更新了系统偏好设置,以允许终端访问开发人员工具等。





jazzy命令可用于我的其他项目,其中一些项目使用SPM,其中让我有些困惑。作为一种解决方法,我将删除SPM并使用迦太基创建所需的Realm和RealmSwift框架。



对于完全支持者:



命令行调用:



< blockquote>

2 /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild
-target Answers -sdk iphoneos

3

4从命令行构建设置:

5 SDKROOT = iphoneos13.4

6

7解析程序包图

8

9已解析的源包:

10领域:



请注意位置柱。这就是您所需要的全部。


删除所有您无法使用的东西。


重新开始,使用url:

  https://github.com/realm/realm-cocoa.git; 

并接受默认值


在图片中:




I have a project which uses SPM (and does not use cocoapods). It compiles and runs fine.

I can run SwiftLint autocorrect from the command line and that works too.

However, when I try to run jazzy on it, I am getting this error:

fatal error: module map file '/Users/Alex/Library/Developer/Xcode/DerivedData/Answers-akfeigwudbzjrkewvufnejnpluej/SourcePackages/checkouts/realm-cocoa/buil d/GeneratedModuleMaps/iphoneos/RealmCore.modulemap' not found

I went through many "fixes" for similar problems: I updated system preferences to allow terminal access to Developer Tools, etc.

The jazzy command works for my other projects, some of which use the SPM, which baffles me a bit. As a workaround, I will remove SPM and use carthage to create the Realm and RealmSwift frameworks I need.

For completists:

Command line invocation:

2 /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -target Answers -sdk iphoneos
3
4 Build settings from command line:
5 SDKROOT = iphoneos13.4
6
7 Resolve Package Graph
8
9 Resolved source packages:
10 Realm: https://github.com/realm/realm-cocoa.git @ 4.4.1
11 Alamofire: https://github.com/Alamofire/Alamofire.git @ 5.1.0
12 RealmCore: https://github.com/realm/realm-core @ 5.23.8
13
14
15 note: Using new build system
16 note: Planning build
17 note: Using build description from disk
18 CompileC /Users/Alex/Library/Developer/Xcode/DerivedData/Answers-akfeigwudbzjrkewvufnejnpluej/SourcePackages/checkouts/realm-cocoa/build/Realm.build/Release -iphoneos/Realm.build/Objects-normal/arm64/collection_notifications.o /Users/Alex/Library/Developer/Xcode/DerivedData/Answers-akfeigwudbzjrkewvufnejnpluej/SourcePackages/checkouts/realm-cocoa/Realm/ObjectStore/src/collection_notifications.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'Realm' from project 'Realm')
19 cd /Users/Alex/Library/Developer/Xcode/DerivedData/Answers-akfeigwudbzjrkewvufnejnpluej/SourcePackages/checkouts/realm-cocoa

20 export LANG=en_US.US-ASCII

21 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -target arm64-apple-ios8.0 -fmessage-length=0 -fdiag nostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=c++14 -fmodules -gmodules -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild -session-file=/var/folders/by/cr9r24wn2fn47wpyjnrq73qc0000gn/C/org.llvm.clang/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build -session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -fmodule-name=Realm -Wno-trigraphs -fpascal-strings -Os - Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missin g-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enu m-conversion -Wno-float-conversion -Wno-non-literal-null-conversion -Wno-objc-literal-conversion -Wshorten-64-to-32 -Wno-newline-eof -Wno-c++11-extensions - DSWIFT_PACKAGE -DREALM_SPM=1 -DREALM_COCOA_VERSION=@\"4.4.1\" -DREALM_VERSION=\"5.23.8\" -DREALM_NO_CONFIG -DREALM_INSTALL_LIBEXECDIR= -DREALM_ENABLE_ASSERT IONS=1 -DREALM_ENABLE_ENCRYPTION=1 -DREALM_VERSION_MAJOR=5 -DREALM_VERSION_MINOR=23 -DREALM_VERSION_PATCH=8 -DREALM_VERSION_EXTRA=\"\" -DREALM_VERSION_STRING=\"5.23.8\" -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.4.sdk -fstrict-aliasing -Wdeprecated -declarations -Winvalid-offsetof -g -fvisibility-inlines-hidden -Wno-sign-conversion -Wno-infinite-recursion -Wno-move -Wno-comma -Wno-block-capture-autorel easing -Wno-strict-prototypes -Wno-range-loop-analysis -Wno-semicolon-before-method-body -fembed-bitcode-marker -I/Users/Alex/Library/Developer/Xcode/Derive dData/Answers-akfeigwudbzjrkewvufnejnpluej/SourcePackages/checkouts/realm-core/src -I/Users/Alex/Library/Developer/Xcode/DerivedData/Answers-akfeigwudbzjrke wvufnejnpluej/SourcePackages/checkouts/realm-cocoa/build/Release-iphoneos/include -I/Users/Alex/Library/Developer/Xcode/DerivedData/Answers-akfeigwudbzjrkew vufnejnpluej/SourcePackages/checkouts/realm-cocoa/include -I/Users/Alex/Library/Developer/Xcode/DerivedData/Answers-akfeigwudbzjrkewvufnejnpluej/SourcePacka ges/checkouts/realm-cocoa -I/Users/Alex/Library/Developer/Xcode/DerivedData/Answers-akfeigwudbzjrkewvufnejnpluej/SourcePackages/checkouts/realm-cocoa/includ e -I/Users/Alex/Library/Developer/Xcode/DerivedData/Answers-akfeigwudbzjrkewvufnejnpluej/SourcePackages/checkouts/realm-cocoa/Realm/ObjectStore/src -I/Users /Alex/Library/Developer/Xcode/DerivedData/Answers-akfeigwudbzjrkewvufnejnpluej/SourcePackages/checkouts/realm-cocoa/build/Realm.build/Release-iphoneos/Realm .build/DerivedSources-normal/arm64 -I/Users/Alex/Library/Developer/Xcode/DerivedData/Answers-akfeigwudbzjrkewvufnejnpluej/SourcePackages/checkouts/realm-cocoa/build/Realm.build/Release-iphoneos/Realm.build/DerivedSources/arm64 -I/Users/Alex/Library/Developer/Xcode/DerivedData/Answers-akfeigwudbzjrkewvufnejnplue j/SourcePackages/checkouts/realm-cocoa/build/Realm.build/Release-iphoneos/Realm.build/DerivedSources -F/Users/Alex/Library/Developer/Xcode/DerivedData/Answers-akfeigwudbzjrkewvufnejnpluej/SourcePackages/checkouts/realm-cocoa/build/Release-iphoneos -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS. platform/Developer/Library/Frameworks -fmodule-map-file=/Users/Alex/Library/Developer/Xcode/DerivedData/Answers-akfeigwudbzjrkewvufnejnpluej/SourcePackages/ checkouts/realm-cocoa/build/GeneratedModuleMaps/iphoneos/RealmCore.modulemap -DXcode -MMD -MT dependencies -MF /Users/Alex/Library/Developer/Xcode/DerivedData/Answers-akfeigwudbzjrkewvufnejnpluej/SourcePackages/checkouts/realm-cocoa/build/Realm.build/Release-iphoneos/Realm.build/Objects-normal/arm64/collection_ notifications.d --serialize-diagnostics /Users/Alex/Library/Developer/Xcode/DerivedData/Answers-akfeigwudbzjrkewvufnejnpluej/SourcePackages/checkouts/realm- cocoa/build/Realm.build/Release-iphoneos/Realm.build/Objects-normal/arm64/collection_notifications.dia -c /Users/Alex/Library/Developer/Xcode/DerivedData/Answers-akfeigwudbzjrkewvufnejnpluej/SourcePackages/checkouts/realm-cocoa/Realm/ObjectStore/src/collection_notifications.cpp -o /Users/Alex/Library/Developer/Xcode/DerivedData/Answers-akfeigwudbzjrkewvufnejnpluej/SourcePackages/checkouts/realm-cocoa/build/Realm.build/Release-iphoneos/Realm.build/Objects-normal/ar m64/collection_notifications.o
22 fatal error: module map file '/Users/Alex/Library/Developer/Xcode/DerivedData/Answers-akfeigwudbzjrkewvufnejnpluej/SourcePackages/checkouts/realm-cocoa/buil d/GeneratedModuleMaps/iphoneos/RealmCore.modulemap' not found
23 warning: Could not read serialized diagnostics file: Cannot Load File: Failed to open diagnostics file (in target 'Realm' from project 'Realm')

Does anyone recognize these symptoms?

解决方案

First of all, whoever just upvoted this - thank you! (it reminded me to come back to this and resolve it)

The solution (now) is simple - use the latest version of RealmSwift

Notice the url in the "Location" column. That's all you need.

Delete whatever you are using that doesn't work.

Starting fresh, use the url:

"https://github.com/realm/realm-cocoa.git" 

and accept the defaults

In pictures:

这篇关于为什么我从命令行找不到xcodebuild致命错误模块映射文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆