缺少 Xcode 在项目中生成的必需模块“SwiftShims”错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/41849335/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 09:44:31  来源:igfitidea点击:

missing required module 'SwiftShims' error generated by Xcode in project

iosswiftxcode

提问by Asim Ifitkhar Abbasi

i copied my project in running state but copied project didn't work for me and actual project is running fine. when i built my copied project its give me following error...

我在运行状态下复制了我的项目,但复制的项目对我不起作用,实际项目运行良好。当我构建我复制的项目时,它给了我以下错误...

enter image description here

在此处输入图片说明

Although i Clear my cache and derived data too but nothing is work for me

虽然我也清除了我的缓存和派生数据,但没有什么对我有用

any one will have idea about that kindly guide me. Thanks in advance

任何人都会对此有想法,请指导我。提前致谢

回答by budidino

If you are using CocoaPods, open yourProject.workspaceinstead of yourProject.xcodeproj.

如果您正在使用CocoaPods,请打开yourProject.workspace而不是yourProject.xcodeproj

回答by Acrasia

Did you try to remove the cache ?

您是否尝试删除缓存?

rm -rf /Users/abdulrehman/Desktop/StudentMentor/DerivedData/ModuleCache/DLJPQMLQI1Q/

(I might have wrong copied your file path. So feel free to type it manually if there is nothing to remove at this path)

(我可能错误地复制了您的文件路径。因此,如果此路径中没有可删除的内容,请随时手动输入)

回答by Azik Abdullah

  • Goto your project folder
  • Delete the contents inside the DerivedDataXcode folder.
  • Clean the project
  • Run.
  • 转到您的项目文件夹
  • 删除 DerivedDataXcode 文件夹中的内容。
  • 清理项目
  • 跑。

回答by kanobius

If you're working with SPM, deleting the .buildfolder and re-running swift buildsolves the issue for me.

如果您使用 SPM,删除.build文件夹并重新运行swift build可以解决我的问题。

回答by villapossu

I had the same error, but the reason turned out to be having different iOS versions specified as Podfile's platform :iosand as my project's deployment target.

我遇到了同样的错误,但原因是将不同的 iOS 版本指定为 Podfileplatform :ios和我的项目的部署目标。

回答by samwize

I have once encountered for a private local pod, which somehow Cocoapod set the lib product name as eg. "MyLib-6c4b1003" -- with a prefix in hex.

我曾经遇到过一个私有的本地 pod,它以某种方式 Cocoapod 将 lib 产品名称设置为例如。“MyLib-6c4b1003”——带有十六进制前缀。

This random hex somehow changed, but the project Other Link Flagsstill using the old one. I did the search to find out the references to the old hex and deleted them, run pod installand the right name will be used.

这个随机的十六进制不知何故改变了,但项目其他链接标志仍然使用旧的。我进行了搜索以找出对旧十六进制的引用并删除它们,运行pod install并使用正确的名称。

I still cannot understand why there is this random hex in the prefix, but seems like Cocoapods setting up of the project could reference to the wrong one.

我仍然无法理解为什么前缀中有这个随机的十六进制,但似乎项目的 Cocoapods 设置可能引用错误的十六进制。