iOS Swift 缺少必需的模块 LegacyCoreKit 单元测试 XCTest

huangapple go评论83阅读模式
英文:

iOS Swift Missing Required Module LegacyCoreKit UnitTest XCTest

问题

I have issue with my UnitTest target.
When I try to run unit test I got error Missing required module 'LegacyCoreKit'
I have no idea what is this framework for. I can't find it in my project and I can't find it in Google.

Do you have any idea where to find this module or how to fix it?
iOS Swift 缺少必需的模块 LegacyCoreKit 单元测试 XCTest

I tried to find this module in Google but there is no sign of it.

英文:

I have issue with my UnitTest target.
When I try to run unit test I got error Missing required module 'LegacyCoreKit'
I have no idea what is this framework for. I can't find it in my project and I can't find it in Google.

Do you have any idea where to find this module or how to fix it?
iOS Swift 缺少必需的模块 LegacyCoreKit 单元测试 XCTest

I tried to find this module in Google but there is no sign of it

答案1

得分: 3

我能够解决这个问题。在我的情况下,这是因为SPM模块未添加到Tests 目标中,而这些模块被用于project 目标

  • 选择Tests 目标
  • 转到Build Phases(构建阶段)
  • 在“Link Binary with Libraries”(链接二进制文件与库)部分,添加在project 目标中使用的所有模块

执行上述步骤后,使用Command + U运行测试。它将成功。

英文:

I am able to resolve this issue. In my case, this was happening due to SPM modules were not being added in Tests target which were being used in project target.

  • Select the Tests target
  • Go to Build Phases
  • In section Link Binary with Libraries, add all the modules which were used in project target

After performing the above mentioned steps, Run the Tests using Command + U. It will be succeeded

答案2

得分: 0

我用"清理构建文件"解决了这个问题。

英文:

I Solved this with "Clean Build Folder"

iOS Swift 缺少必需的模块 LegacyCoreKit 单元测试 XCTest

答案3

得分: 0

只需添加模块并将headers设置为true。

更新pod如下:

pod '需要添加的库', :modular_headers => true
英文:

You just need to add the modulars and set headers to true.

update pod like this,

pod 'LIBRARY WICH YOU NEED TO ADD', :modular_headers => true

答案4

得分: 0

在我的情况下,需要使用Firebase库、GoogleSignIn和FacebookSignIn来运行测试,所以我得到了'LegacyCoreKit'警告。我将这些库添加到TestTarget -> Build Phases,问题得以解决。

英文:

In my case Firebase libraries, GoogleSignIn and FacebookSignIn are required to run the tests, so I got the 'LegacyCoreKit' warning. I added these libraries to TestTarget -> Build Phases and the issue was solved.

huangapple
  • 本文由 发表于 2023年3月8日 18:51:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/75672082.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定