Reputation: 4912
After I run ProjectNameTests.m (empty test file) by doint Product -> Test
the project builds successfully, but it throws and gives me the following error:
2016-01-10 11:25:32.677 xctest[66104:5611958] The bundle “ProjectNameTests” couldn’t be loaded. Try reinstalling the bundle.
2016-01-10 11:25:32.677 xctest[66104:5611958] (dlopen(/Users/XYZ/Library/Developer/Xcode/DerivedData/ProjectName-dnwnjlzdzxbcyydkxsumlvokmhvk/Build/Products/Debug-iphonesimulator/ProjectNameTests.xctest/ProjectNameTests, 265): Symbol not found: _FBSDKErrorArgumentCollectionKey
Referenced from: /Users/XYZ/Library/Developer/Xcode/DerivedData/ProjectName-dnwnjlzdzxbcyydkxsumlvokmhvk/Build/Products/Debug-iphonesimulator/ProjectNameTests.xctest/ProjectNameTests
Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Agents/xctest
in /Users/XYZ/Library/Developer/Xcode/DerivedData/ProjectName-dnwnjlzdzxbcyydkxsumlvokmhvk/Build/Products/Debug-iphonesimulator/ProjectNameTests.xctest/ProjectNameTests)
Program ended with exit code: 83
I've tried removing UIKit from Tests, changing Match-O type, switching simulator to iPhone 5 and other things suggested in similar answers, without any luck. Any ideas?
Upvotes: 16
Views: 12920
Reputation: 1460
I had a similar issue and in my case it also was signing issue. Make sure that the hosting app is set to the same development team as the test target. Adjusting signing of both targets to match the same development team fixed it for me.
Thanks for pointing me into the right direction. From the error message I would have never thought it was a "good old signing issue" :-)
Upvotes: 0
Reputation: 1639
Sometimes, this error can also happen for a dumb reason : zero tests in target.
Double check your configuration.
Upvotes: 0
Reputation: 11
I think I am late, But what worked for me is.
When creating Unit Testing Bundle for existing project check following points.
If you're using Firebase Pods
Restart the Xcode. And you're good to go.
Upvotes: 1
Reputation: 632
Answering this years later (Xcode 13.4) but hopefully this will help someone!
My issue was related to Code Signing.
Go to your test target's Build Settings and:
You may have to create an Apple Distribution certificate if one does not already exist.
Here are the steps to create it:
+
icon in the bottom left and select Apple Distribution
.Upvotes: 4
Reputation: 1586
Even I got the same error where I have solved it following the below step
Set the Test Host in Build settings of the test target to $(BUNDLE_LOADER)
Actually I was trying to add unit tests to already exists project where I should follow the procedure in the method given in the link Adding Unit Tests to an existing iOS project with Xcode 4 where I have missed that step
Upvotes: 2
Reputation: 4731
I have an error with exit code 83 not being able to recognize a symbol from an external library added to project.
In my case, it was resolved by setting "Host application" to app in the tests target General configuration. I also have checked "Allow testing host Application APIs"
Upvotes: 2
Reputation: 651
I just had a similar issue and it turned out that the Xcode project was set to a deployment target of 7.2, but expecta and septa required 8.0 or greater.
Upvotes: 2