Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests Failing Without Running in Xcode 6 RC #141

Closed
snown opened this issue Sep 10, 2014 · 8 comments
Closed

Tests Failing Without Running in Xcode 6 RC #141

snown opened this issue Sep 10, 2014 · 8 comments

Comments

@snown
Copy link

snown commented Sep 10, 2014

When I run my tests after installing Quick and Nimble I get a Tests Failed message with the following log:

Test target Tests encountered an error (Test session exited(82) without checking in. Executable cannot be loaded for some other reason, such as a problem with a library it depends on or a code signature/entitlements mismatch. Retry after a Clean build. If you believe this error represents a bug, please attach the log file at /var/folders/38/fm3x411100v9lp48n_py3dlh0000gn/T/com.apple.dt.XCTest-status/Session-2014-09-10_11:39:20-JbO0b7.log)

I did try a clean build to no avail.

Here is the log file referenced above: fm3x411100v9lp48n_py3dlh0000gn/T/com.apple.dt.XCTest-status/Session-2014-09-10_11:39:20-JbO0b7.log

Thanks for any insight.

@modocache
Copy link
Member

I haven't had the chance to look into it, but I've heard rumors that the install location of XCTest in the Xcode 6 GM has changed. Maybe that has something to do with this error?

I'll look into this as soon as I can. Thanks for the heads up, @snown!

@snown
Copy link
Author

snown commented Sep 10, 2014

Thanks @modocache.

I had an issue with Cocoapods not finding the XCTest framework, and managed to resolve the error I was getting in Xcode 6 RC by following some suggestions in this Stack Overflow Question. However, applying that same $(PLATFORM_DIR)/Developer/Library/Frameworks search path to Quick and/or Nimble didn't seem to resolve this issue.

Thanks for the quick (pun semi-intended) response!

@modocache
Copy link
Member

@snown I encountered the exact same error message as you. Here's how it happened, and how I was able to solve it:

  1. Create a new iOS app project using Xcode 6.1b2 (6A1030). Build and run to confirm everything works.
  2. Add Quick to the project using the installation instructions in the README.
  3. Add a simple spec with a single it closure and a test that always succeeds: expect(1).to(equal(1)).
  4. Run the tests, confirm the single it statement passes.
  5. Close Xcode 6.1b2, open the project in Xcode 6.0 (6A313).
  6. Run the tests. Confirm the following error message (the exact same one you reported) appears in the console:
Test target Tests encountered an error (Test session exited(82) without checking in. Executable cannot be loaded for some other reason, such as a problem with a library it depends on or a code signature/entitlements mismatch. Retry after a Clean build.

The solution was to quit all instances of Xcode, remove the DerivedData folder at ~/Library/Developer/Xcode/DerivedData, and run the unit tests again.

The same step is probably necessary every time you switch between versions of Xcode.

tl;dr: @snown try deleting the DerivedData directory and running the tests again. 🍸 ✨

If that doesn't solve your problem, either comment on this issue and I'll reopen it, or open a new issue. Thanks again for the report!!

@phatblat
Copy link
Member

FYI, I was getting this error consistently in Xcode 6.2 beta (6C86e) until I went back and noticed that I forgot to add a swift file to the test target. After that, the message went away and tests started running.

@52doho
Copy link

52doho commented Dec 16, 2014

Try to add @import UIKit; to any of your test classes fix this.

Reference:
The bundle couldn’t be loaded because it is damaged or missing necessary resources.
http://mathijskadijk.nl/

@codeblooded
Copy link
Contributor

@modocache I think this may still be an issue. I deleted the DerivedData folder in my recent app, and the same error was shown. I noticed @52doho's comment about importing UIKit, but, unfortunately, the error is still there. I'm attaching the message:

IDEBundleInjection.c: Error 3587 loading bundle '/Users/ben/Library/Developer/Xcode/DerivedData/TimeMath-cwdbxiewgonhqvfyglhwqjyahhia/Build/Products/Debug-iphonesimulator/TimeMathTests.xctest': The bundle “TimeMathTests” couldn’t be loaded because it is damaged or missing necessary resources.
DevToolsBundleInjection environment:
XCInjectDiagnostics: (null)
XCInjectBundleInto: /Users/ben/Library/Developer/Xcode/DerivedData/TimeMath-cwdbxiewgonhqvfyglhwqjyahhia/Build/Products/Debug-iphonesimulator/TimeMath.app/TimeMath
XCInjectBundle: /Users/ben/Library/Developer/Xcode/DerivedData/TimeMath-cwdbxiewgonhqvfyglhwqjyahhia/Build/Products/Debug-iphonesimulator/TimeMathTests.xctest
TestBundleLocation: /Users/ben/Library/Developer/Xcode/DerivedData/TimeMath-cwdbxiewgonhqvfyglhwqjyahhia/Build/Products/Debug-iphonesimulator/TimeMathTests.xctest
TMPDIR: /Users/ben/Library/Developer/CoreSimulator/Devices/5FB25F15-A1AF-4BE2-BE22-0B4F28652BB9/data/Containers/Data/Application/86AF197D-3E0C-45EF-87AB-6158543A0FFB/tmp
DYLD_LIBRARY_PATH: /Users/ben/Library/Developer/Xcode/DerivedData/TimeMath-cwdbxiewgonhqvfyglhwqjyahhia/Build/Products/Debug-iphonesimulator
DYLD_INSERT_LIBRARIES: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks/IDEBundleInjection.framework/IDEBundleInjection
DYLD_FRAMEWORK_PATH: /Users/ben/Library/Developer/Xcode/DerivedData/TimeMath-cwdbxiewgonhqvfyglhwqjyahhia/Build/Products/Debug-iphonesimulator
DYLD_FALLBACK_LIBRARY_PATH: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib
DYLD_FALLBACK_FRAMEWORK_PATH: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks


*** Test session exited(82) without checking in. Executable cannot be loaded for some other reason, such as a problem with a library it depends on or a code signature/entitlements mismatch. Retry after a Clean build. If you believe this error represents a bug, please attach the log file at /var/folders/k6/zlppzhg51fqf_9yjqw3r0ymh0000gn/T/com.apple.dt.XCTest-status/Session-2015-02-08_01:57:50-FHMj8N.log

@marciok
Copy link
Member

marciok commented Feb 23, 2015

Hi @codeblooded did you try to:

  1. Delete all Quick and Nimble references from your project;
  2. Delete the app from the simulator;
  3. Include them again;
  4. Write a passing test;

That solved the problem for me.

@paulyoung
Copy link
Contributor

Adding import UIKit / import AppKit was the solution in my case.

NachoSoto pushed a commit to NachoSoto/Quick that referenced this issue Jul 18, 2016
expectAction(...) requires a void block argument
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants