Unit test error in Xcode 9 and Simulator iOS 11 - ios

I get the following error in Xcode 9 and Simulators with iOS 11. It's very weird as all the test cases are running fine in Xcode 9 with simulator iOS 9. It seems to be some kind of issue with Xcode 9 and Simulator iOS 11.
Assertion failure in void _XCTestMain(XCTestConfiguration *)(),
/Library/Caches/com.apple.xbs/Sources/XCTest_Sim/XCTest-13201/Sources/XCTestFramework/Harness/XCTestMain.m:62
2017-11-06 16:26:51.080851-0600 xctest
[17644:81518] Terminating app due to uncaught exception
'NSInternalInconsistencyException', reason: 'No test bundle found at
file:///Users/xxxx/Code/iOS-SDK/ContentSDK/build/Debug/ContentSDKTests.xctest/

For me the problem was in the lowercase letter in 'build' directory name. I used parameter '-derivedDataPath build' for xcodebuild. Try to compare the real build directory name on the filesystem with the name in the error message.

It's a wired issue. I have created a simulator from Xcode -> window-< Devices & simulators and the unit test started working fine.

Related

_XCTFailInCurrentTest should only be called while a test is running

I am now doing for UITesting with Xcode and I got this error.
* Assertion failure in void _XCTFailInCurrentTest(NSString *,
...)(),
/Library/Caches/com.apple.xbs/Sources/XCTest_Sim/XCTest-10112/XCTestFramework/Classes/XCTestCase.m:63
2016-05-13 22:31:54.961 XCTRunner[15428:168507] * Terminating app
due to uncaught exception 'NSInternalInconsistencyException', reason:
'_XCTFailInCurrentTest should only be called while a test is running.
Failure description: Failed to receive completion for
I have seen other similar post here.
Cannot run Xcode (7.3) UI tests in Jenkins
I am using Jenkins but for now, I am directly running from Xcode and I can't even run from Xcode. How shall I do?
Background
I faced this issue in Xcode 7.3 (7D175) and iOS Simulator 9.3.
The symptoms were as follows
the Test Runner launches normally and exits.
Following this, the app under test never launches.
(if the app under test was not installed, Xcode will also never install the app prior to starting the test).
(a side symptom is that recording also does not work for me - I took inspiration from this SO post.)
After 30 seconds the test times out with:
XCTRunner[36260:489138] Continuing to run tests in the background with task ID 1
2016-05-18 16:17:25.720 XCTRunner[36260:489138] *** Assertion failure in void _XCTFailInCurrentTest(NSString *, ...)(), /Library/Caches/com.apple.xbs/Sources/XCTest_Sim/XCTest-10112/XCTestFramework/Classes/XCTestCase.m:63
2016-05-18 16:17:25.723 XCTRunner[36260:489138] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '_XCTFailInCurrentTest should only be called while a test is running.
Failure description: Failed to receive completion for <XCDeviceEvent:0x7fddc241f970 page 12 usage 64 duration 0.01s within 30.0s'
The fix that worked for me was:
reset the simulator.
check whether the deployment target is set to iOS 9.x in the build settings for the UI Test Target. (in my case it was set to iOS 8)
after changing the target, clean and rebuild.
After following these steps, Xcode was able to install the app prior to the test, recording worked, and the error went away.
By some reason simulator got corrupted. In my case it was not possible to launch any test once get at the same point. In my case what it worked was reset simulator (Menu Simulator|Reset Contents and Settings...) or switch to any other simulator.
We tried the tips from the other responses, which did not work for us.
A complete reinstall of Xcode 7.3 fixed our issue.
remove Xcode
restart
reinstall Xcode
success

iOS App crash on start when debugging WatchKit Extension

I am developing an iOS app and its watch kit extension and trying to run them on the simulator with Xcode 6.4.
Both of them run fine on real devices, but unfortunately I don't own the AppleWatch I use for testing so I have to test the extension on the simulator.
If I run the app alone it's all ok, but when I run the extension and tap on the app on the iPhone simulator, it crashes immediately and I can't figure out why.
Sep 12 11:52:44 MacBook-Pro-** assertiond[22563]: assertion failed: 14F27 12H141: assertiond + 12334 [EDAF3958-87C7-3C61-A8E6-24689FBBE168]: 0x1
Sep 12 11:52:44 MacBook-Pro-**.local SpringBoard[29507]: LICreateIconForImage passed NULL CGImageRef image
Sep 12 11:52:45 MacBook-Pro-** com.apple.CoreSimulator.SimDevice.0868CE09-5C9E-4445-A8C9-48F00AA445AF.launchd_sim[22544] (UIKitApplication:**myAppBundleId**[0xb354][29533]): Service exited due to signal: Trace/BPT trap: 5
Everything used to work some days ago, so I must have done something wrong...
Still I don't know what was the reason that caused this behavior, but I resolved by using this tool: https://github.com/kylef/cocoapods-deintegrate
I removed any trace of cocoapods from the project and then reinstalled all the pods again.
After that everything went back to normal.

How to fix sqlite3 libversion mismatch

I just updated to the latest Xcode, version 6.2 and started seeing this error when running my app.
libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: sqlite3 libversion mismatch: headers report 3007013, but library reports 3008005
The error shows up running in the simulator using iOS 8.2, but works fine in iOS 8.1. My app includes libsqlite3.dylib from Apple.
Any suggestions on the cause or how to resolve?
Looks like an issue with MapboxGL and ios 8.2 as described here:
https://github.com/mapbox/mapbox-gl-native/issues/968
This looks like the version check in question:
https://github.com/mapbox/mapbox-gl-native/blob/b56b618abf0b15025b61ab96dcc873cf7af82450/platform/default/sqlite3.cpp

iOS Simulator Crash in App with Embedded Binary

I'm having a strange issue and wondering if anyone knows what is going on. In Xcode 6.2, if you follow these steps:
create a new workspace
create a new iOS > Application> Single View Application project in
the workspace
create a new iOS > Framework & Library > Cocoa Touch Framework
project in the workspace
add the framework as an embedded binary in the app
build and run the app on any 8.2 simulator and then stop it
launch the app from within the simulator
Every time you try to launch the app from within the simulator (not running it from Xcode, but actually clicking on the app icon inside the simulator) the app crashes on startup. The only thing I see in the system log is:
Apr 3 20:04:53 MacBook com.apple.CoreSimulator.SimDevice.6B002DFB-FE6C-4295-BA22-742E4CEE2B6D.launchd_sim[61494] (UIKitApplication:com.test.TestApp[0xcb1d][61787]): Service exited due to signal: Trace/BPT trap: 5
Apr 3 20:04:53 MacBook.local SpringBoard[61507]: Application 'UIKitApplication:com.test.TestApp[0xcb1d]' crashed.
Apr 3 20:04:53 MacBook assertiond[61511]: assertion failed: 14C1514 12D508: assertiond + 14743 [849F745E-3AAA-3638-91FF-892312A54F42]: 0x1
Does anyone know if this is by-design or if embedded binaries work correctly? I'm hesitant to add an embedded binary to my app if the app always crashes in the simulator.
Thanks!
- Tom B.

XCode 5 crashes on every tries to add a UIButton on Toolbar using storyboard [0x7f9fc960ef80]

I'm working on a iPad project (iOS 7). Every times i try to add a UIButton on a UIToolbar using storyboard in XCode 5 (build 5A1413), I receive this error message:
UNCAUGHT EXCEPTION (NSInvalidArgumentException): -[IBUIButton ibViewControllerEffectiveSimulatedMetricsDidChange]: unrecognized selector sent to instance 0x7f9fc960ef80
I started my project from scratch using XCode 5 and iOS 7 (this is not a migration from iOS 6) I tried to clean project and rebuild with no success. I tried a search on Google for this error code but it returns 0 results.
Any suggestions ?

Resources