Xcode:模块名称“"运行 XC 单元测试时不是有效标识符 [英] Xcode : module name "" is not a valid identifier while running XC unit test

查看:19
本文介绍了Xcode:模块名称“"运行 XC 单元测试时不是有效标识符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试使用 SDWebImage 设置我的 CocoaPods 来运行 XCTest,我只能看到如下错误.有什么建议吗?

Trying to run XCTest with my CocoaPods set up using SDWebImage, and I can only see this error as below. Any suggestions?

:0: 错误:模块名称 "" 不是有效标识符命令/Applications/Xcode8.3.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc 失败,退出代码 1

:0: error: module name "" is not a valid identifier Command /Applications/Xcode8.3.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1

但是一旦我编辑了方案并取消选中构建中的测试,我就可以在模拟器上运行应用程序,但无法运行测试.

But as soon as I edit the scheme and uncheck the test inside the builds, I am able to run the app on simulator but can't run the tests.

推荐答案

始终确保所有测试目标都将 PRODUCT_MODULE_NAME 设置为 $(PRODUCT_NAME)

Always make sure all your test targets has the PRODUCT_MODULE_NAME set to $(PRODUCT_NAME)

这篇关于Xcode:模块名称“"运行 XC 单元测试时不是有效标识符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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