I have a Swift project including a test target, on GitHub: GitHub - mshibanami/GitHubTrendingRSS: Unofficial RSS feed generator for GitHub Trending
When I ran swift test
for that, then I got errors like this:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:20:10: error: could not build module 'Dispatch'
#include <dispatch/dispatch.h>
This is the actual log: https://github.com/mshibanami/GitHubTrendingRSS/runs/431904961?check_suite_focus=true
However, this never happens on Xcode with generated xcodeproj by swift package generate-xcodeproj
.
Also, when I went through these steps, then swift test
tests all cases precisely:
- Remove the dependencies from
testTarget
inPackage.swift
- Run
swift test
and getld: symbol(s) not found for architecture x86_64
error - Restore the removed dependencies
- Run
swift test
again
But since the errors are raised again when I ran swift clean
, it doesn't completely resolve this problem.
What is the problem and how can I fix this?