Xcode : module name “” is not a valid identifier while running XC unit test

允我心安 提交于 2020-07-19 04:13:08

问题


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

: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.


回答1:


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




回答2:


I was able to fix the problem by following the steps below while migrating from Xcode 11 to 11.2: 1. Select the target 2. Go to Build Settings. 3. Then scroll down to Packaging 4. Product module name 5. If you have spaces in your module name with underscores



来源:https://stackoverflow.com/questions/45289802/xcode-module-name-is-not-a-valid-identifier-while-running-xc-unit-test

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!