Cannot load underlying module for XCTest
The main project does not link with the XCUnit framework. You should create a separate testing target for your project, if one does not already exist, and add your test source files to that target.
- Select your project in the Project Navigator. This will open the project's settings in the editor.
- Click the "+" button at the bottom of the column listing your Targets.
If you are working on an iOS project template, select
iOS > Test > iOS Unit Testing Bundle
.If you are working on an OS X project template, select
OS X > Test > OS X Unit Testing Bundle
.
Cannot load underlying module for 'XCTest'
You accidentally added one of your Xcode Unit Test files to your main app target.
Remove it:
- Select test file
- Open right side panel
- Select Identity and Type tab
- Unselect your app Target (not the unit test lego icon)
Tip:
Next time you add a new unit test, only add it to your unit test target. If you accidentally include any of your app targets, they will not have the XCTest framework available.
Cannot load underlying module for unit tests
Finally, after examining each commit to see where it breaked, it turns out that the problem was probably coming from a unit test file I created, which had the same issue (probably didn't created it correctly), and then only removed its references instead of moving it to trash.
So I went a commit backward, used the default unit test file generated, and it worked.
Subclass XCTestCase results in cannot load underlying module XCTest
Under Framework Search Paths
in Build Settings I have to add: $(PLATFORM_DIR)/Developer/Library/Frameworks
Then everything compiles fine :)
Cannot load underlying module for 'RealmSwift'
Firstly try to check what workspace you open after cocoapods were install open App.xcworkspace file.If yes open Pods directory and check if file is actually installed by manually navigation to REALM folder. After navigation to this article it is possible to conclude that you should:
New project -> build&run -> add realm via cocoapods -> open Xcode
workspace -> build&run again = success
Failed to load module 'project name'
Click on scheme -> Edit scheme -> select Test -> under info select Build configuration for which Enable testability is Yes. this solved my issue.
Related Topics
How to Simulate Mouse Click from MAC App to Other Application
Process Array in Parallel Using Gcd
Swiftui Set Position to Center of Different View
How to Capture Depth Data from Camera in iOS 11 and Swift 4
Private Var Is Accessible from Outside the Class
How to Pause and Resume Nstimer.Scheduledtimerwithtimeinterval in Swift
How Constant Is the Firebase Anonymous Id
Add Animations to Foreach Loop Elements (Swiftui)
How to Tell If a Node Is on the Screen Spritekit Swift
Swift Update Label (With HTML Content) Takes 1Min
How Do People Deal with Iterating a Swift Struct Value-Type Property
Checking If an Array of Custom Objects Contain a Specific Custom Object
What Does the '@' Symbol Mean in Swift
How to Calculate the 21! (21 Factorial) in Swift