UI Tests Flaky on CI - ios

update:
VNC into the build machine (without making any changes) somehow fixes this....strange
Context
We use Mac EC2 instances CI cluster to run UI tests. The cluster is set up to recycle every night. Meaning new cluster is provisioned in the morning. We notice that the tests get increasing more and more flaky throughout the day.
Build 312 is the first build in the morning.
Red is failed tests, Orange is silenced tests, Yellow is flaky tests, Grey is unknown status
The commit are just white space auto commit that trigger off builds. The tests content are the same.
Note: Bluepill configure to run one Simulator per machine (no concurrency)
Log
The flaky test or failure are usually due to "waiting for some resource to idle" and reach timeout, or some network request to finish. The tests that failed or flaky also has a commonality which is they are usually related to video
Here are a couple sample logs
Waiting for app to idle
Timed out waiting for app to idle.
The following idling resources are busy.
1. GREYAppStateTracker:
Waiting for network requests to finish. By default, EarlGrey tracks all network requests. To change this behavior, refer to GREYConfiguration.
<__NSCFLocalDataTask:0x7fcfcfd87450, URL:"https://v.myorgimg.com/videos/mc/hls/e7/01/ca/e701caebac12684056eb699f316fc411_360w.m3u8"> => Waiting for network requests to finish. By default, EarlGrey tracks all network requests. To change this behavior, refer to GREYConfiguration.
(
0 MyorgDevelopmentEG2 0x000000010ebf3205 -[GREYAppStateTrackerObject setState:] + 69
1 MyorgDevelopmentEG2 0x000000010ebf22b3 __133-[GREYAppStateTracker grey_changeState:usingOperation:forObject:orInternalObjectDeallocationTracker:orExternalAppStateTrackerObject:]_block_invoke + 931
2 MyorgDevelopmentEG2 0x000000010ebf18f0 -[GREYAppStateTracker grey_performBlockInCriticalSection:] + 224
3 MyorgDevelopmentEG2 0x000000010ebf1e34 -[GREYAppStateTracker grey_changeState:usingOperation:forObject:orInternalObjectDeallocationTracker:orExternalAppStateTrackerObject:] + 1076
4 MyorgDevelopmentEG2 0x000000010ebf0ac6 -[GREYAppStateTracker trackState:forObject:] + 102
5 MyorgDevelopmentEG2 0x000000010ebca867 -[__NSCFLocalDataTask_GREYApp grey_track] + 135
6 MyorgDevelopmentEG2 0x000000010ebcac55 -[__NSCFLocalDataTask_GREYApp greyswizzled_resume] + 181
7 MediaToolbox 0x00007fff2b617285 figHttpRequestSetupNSURLSessionTask + 1380
8 MediaToolbox 0x00007fff2b616bb6 _FigHTTPRequestCreateWithNSURLSession + 2923
9 MediaToolbox 0x00007fff2b64aaaf figHTTPRequestSessionNSCreateHTTPRequest + 199
10 MediaToolbox 0x00007fff2b71f5b1 segPumpCreateHTTPRequest + 944
11 MediaToolbox 0x00007fff2b721de6 segPumpSendIndexFileRequest + 1703
12 MediaToolbox 0x00007fff2b7431d5 segPumpRequestIndexForStream + 753
13 MediaToolbox 0x00007fff2b7421ee segPumpSetAlternateForStream + 3145
14 MediaToolbox 0x00007fff2b73e9e5 segPumpSetCurrentAlternate + 9898
15 MediaToolbox 0x00007fff2b791d6a ProduceStreamingAssetProperty + 661
16 MediaToolbox 0x00007fff2b78e07c URLAssetPropertyWorkFunction + 872
17 libdispatch.dylib 0x00007fff201078df _dispatch_client_callout + 8
18 libdispatch.dylib 0x00007fff2010de15 _dispatch_lane_serial_drain + 715
19 libdispatch.dylib 0x00007fff2010e9c3 _dispatch_lane_invoke + 455
20 libdispatch.dylib 0x00007fff20117a8e _dispatch_root_queue_drain + 350
21 libdispatch.dylib 0x00007fff2011786c _dispatch_worker_thread + 222
22 libsystem_pthread.dylib 0x00007fff60342950 _pthread_start + 224
23 libsystem_pthread.dylib 0x00007fff6033e47b thread_start + 15
)
and waiting for network request to finish
9. GREYAppStateTracker:
Waiting for network requests to finish. By default, EarlGrey tracks all network requests. To change this behavior, refer to GREYConfiguration.
Waiting for UIView's draw/layout pass to complete. A draw/layout pass normally completes in the next runloop drain.
<ASCollectionView: 0x7feca21ad000> => Waiting for UIView's draw/layout pass to complete. A draw/layout pass normally completes in the next runloop drain.
(
0 MyorgDevelopmentEG2 0x000000010bb2e335 -[GREYAppStateTrackerObject setState:] + 69
1 MyorgDevelopmentEG2 0x000000010bb2d3e3 __133-[GREYAppStateTracker grey_changeState:usingOperation:forObject:orInternalObjectDeallocationTracker:orExternalAppStateTrackerObject:]_block_invoke + 931
2 MyorgDevelopmentEG2 0x000000010bb2ca20 -[GREYAppStateTracker grey_performBlockInCriticalSection:] + 224
3 MyorgDevelopmentEG2 0x000000010bb2cf64 -[GREYAppStateTracker grey_changeState:usingOperation:forObject:orInternalObjectDeallocationTracker:orExternalAppStateTrackerObject:] + 1076
4 MyorgDevelopmentEG2 0x000000010bb2bbf6 -[GREYAppStateTracker trackState:forObject:] + 102
5 MyorgDevelopmentEG2 0x000000010bb02b0d -[UIView(GREYApp) greyswizzled_setNeedsLayout] + 93
6 UIKitCore 0x00007fff24ba5675 -[UIScrollView setNeedsLayout] + 79
7 UIKitCore 0x00007fff23dc0390 -[UICollectionView _updateAnimationDidStop:finished:context:] + 2236
8 UIKitCore 0x00007fff23dbf9e4 __102-[UICollectionView _updateWithItems:tentativelyForReordering:propertyAnimator:collectionViewAnimator:]_block_invoke.2110 + 77
9 MyorgDevelopmentEG2 0x000000010bb2fdef __60-[GREYDispatchQueueTracker grey_dispatchAsyncCallWithBlock:]_block_invoke + 47
10 libdispatch.dylib 0x00007fff2010670d _dispatch_call_block_and_release + 12
11 libdispatch.dylib 0x00007fff201078df _dispatch_client_callout + 8
12 libdispatch.dylib 0x00007fff20114a27 _dispatch_main_queue_callback_4CF + 1045
13 CoreFoundation 0x00007fff203908f8 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
14 CoreFoundation 0x00007fff2038b169 __CFRunLoopRun + 2781
15 CoreFoundation 0x00007fff2038a1a7 CFRunLoopRunSpecific + 567
16 GraphicsServices 0x00007fff2b874d85 GSEventRunModal + 139
17 UIKitCore 0x00007fff246c14df -[UIApplication _run] + 912
18 UIKitCore 0x00007fff246c639c UIApplicationMain + 101
19 MyorgDevelopmentEG2 0x0000000108f175de main + 190
20 libdyld.dylib 0x00007fff2025abbd start + 1
21 ??? 0x0000000000000005 0x0 + 5
)
<_ASDisplayLayer: 0x600007996580> => Waiting for UIView's draw/layout pass to complete. A draw/layout pass normally completes in the next runloop drain.
Hypothesis
This leads me to think there are some orphaned subprocess or daemon that still holds onto to resources. Or there are artifacts not being clean up properly.
Things I have tried
shutdown, erase, delete all simulator between builds (No Help)
xcrun simctl shutdown all
xcrun simctl erase all
xcrun simctl delete all
osascript -e 'tell application "iOS Simulator" to quit'
osascript -e 'tell application "Simulator" to quit'
Kill CoreSimulator related services between builds (No Help)
launchctl remove com.apple.CoreSimulator.CoreSimulatorService || true
launchctl remove com.apple.CoreSimulator.SimLaunchHost-x86 || true
launchctl remove com.apple.CoreSimulator.SimulatorTrampoline || true
launchctl remove com.apple.CoreSimulator.SimLaunchHost-arm64 || true
delete simulator devices, logs, and cache between builds. This actually helped a bit. The flakiness went away initially but came back quickly after a few builds while the machines still performing the cleaning between builds....unsure why.
echo "Delete all simulator devices, cache, and temp"
rm -rf ~/Library/Developer/CoreSimulator
echo "Delete Simulator Logs"
rm -rf ~/Library/Logs/CoreSimulator
Increase Animation Timeout, Interaction Timeout, on EarlGrey
Blacklist the URL the request hung on. This did improve the stability of the test suite by ignoring the symptom and not fixing the actual probelm so I am hoping I can avoid this.
Anyone else running into the same issue? Appreciate if someone can shed any light on this or give suggestions to try.
Note: We uses Bluepill and EarlGrey2 to run UI tests (iOS 14.5, Xcode 12.5) on Buildkite CI pipeline.

Have you tried running:
sudo systemsetup -setcomputersleep never

Related

iOS Production build (EAS, Expo) crashes directly after opening the App

I have a problem with the IOS part of my ReactNative App. The Android part works fine. When I create an development build (eas build --profile development --platform ios) there is no problem. But the preview and production builds crash directly after opening the App. The EAS build pipelines have no problems except for one message
fatal error: module 'React' in AST file '/Users/expo/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/1XDLP1ZNNJOAB/React-ISQBUSD1JGEA.pcm' (imported by AST file '/Users/expo/Library/Developer/Xcode/DerivedData/MY_APP_NAME-hkvdfgprzzhwypayqwweanuiqofc/Build/Intermediates.noindex/ArchiveIntermediates/MY_APP_NAME/PrecompiledHeaders/MY_APP_NAME-Bridging-Header-swift_3BATV8FO0GBUP-clang_1XDLP1ZNNJOAB.pch') is not defined in any loaded module map file; maybe you need to load '/Users/expo/workingdir/build/ios/Pods/Headers/Public/React-Core/React/React-Core.modulemap'?
I’m not sure if the this is related to my problem because it doesn’t lead to a build failure and the dev Build has the same error message but doesn’t crash.
The App is already published to TestFlight. Therefore, I have the crash reports from the device.
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread: 13
…
Thread 13 name:
Thread 13 Crashed:
0 libsystem_kernel.dylib 0x00000001e5b5a200 __pthread_kill + 8
1 libsystem_pthread.dylib 0x00000001f5d971ac pthread_kill + 268 (pthread.c:1670)
2 libsystem_c.dylib 0x00000001b0951ca0 abort + 180 (abort.c:118)
3 libsystem_c.dylib 0x00000001b09a8890 __assert_rtn + 272 (assert.c:96)
4 MY_APP_NAME 0x000000010487f8d4 facebook::jsc::JSCRuntime::~JSCRuntime() + 136 (JSCRuntime.cpp:393)
5 MY_APP_NAME 0x000000010487f97c ~JSCRuntime + 4 (JSCRuntime.cpp:383)
6 MY_APP_NAME 0x000000010487f97c facebook::jsc::JSCRuntime::~JSCRuntime() + 12 (JSCRuntime.cpp:383)
7 MY_APP_NAME 0x00000001046d88f0 __release_shared + 40 (shared_ptr.h:177)
8 MY_APP_NAME 0x00000001046d88f0 __release_shared + 40 (shared_ptr.h:219)
9 MY_APP_NAME 0x00000001046d88f0 std::__1::shared_ptrfacebook::react::CallInvoker::~shared_ptr() + 64 (shared_ptr.h:959)
10 MY_APP_NAME 0x000000010488cea4 ~shared_ptr + 4 (shared_ptr.h:957)
11 MY_APP_NAME 0x000000010488cea4 facebook::react::JSIExecutor::~JSIExecutor() + 268 (JSIExecutor.h:71)
12 MY_APP_NAME 0x000000010488cd90 ~JSIExecutor + 4 (JSIExecutor.h:71)
13 MY_APP_NAME 0x000000010488cd90 facebook::react::JSIExecutor::~JSIExecutor() + 12 (JSIExecutor.h:71)
14 MY_APP_NAME 0x00000001047c9d64 operator() + 20 (function.h:505)
15 MY_APP_NAME 0x00000001047c9d64 operator() + 20 (function.h:1182)
16 MY_APP_NAME 0x00000001047c9d64 facebook::react::tryAndReturnError(std::__1::function<void ()> const&) + 32 (RCTCxxUtils.mm:74)
17 MY_APP_NAME 0x00000001047d61ec facebook::react::RCTMessageThread::tryFunc(std::__1::function<void ()> const&) + 24 (RCTMessageThread.mm:69)
18 MY_APP_NAME 0x00000001047d694c operator() + 20 (function.h:505)
19 MY_APP_NAME 0x00000001047d694c operator() + 20 (function.h:1182)
20 MY_APP_NAME 0x00000001047d694c operator() + 24 (RCTMessageThread.mm:61)
21 MY_APP_NAME 0x00000001047d694c __invoke<(lambda at /Users/expo/workingdir/build/node_modules/react-native/React/CxxBridge/RCTMessageThread.mm:60:12) &> + 24 (type_traits:3918)
22 MY_APP_NAME 0x00000001047d694c __call<(lambda at /Users/expo/workingdir/build/node_modules/react-native/React/CxxBridge/RCTMessageThread.mm:60:12) &> + 24 (invoke.h:61)
23 MY_APP_NAME 0x00000001047d694c operator() + 24 (function.h:178)
24 MY_APP_NAME 0x00000001047d694c std::__1::__function::__func<facebook::react::RCTMessageThread::runSync(std::__1::function<void ()>)::$_0, std::__1::allocator<facebook::react::RCTMessageThread::runSync(std::__1::function<void ()>… + 40 (function.h:352)
25 MY_APP_NAME 0x00000001047d5fa0 operator() + 20 (function.h:505)
26 MY_APP_NAME 0x00000001047d5fa0 operator() + 20 (function.h:1182)
27 MY_APP_NAME 0x00000001047d5fa0 invocation function for block in facebook::react::RCTMessageThread::runAsync(std::__1::function<void ()>) + 44 (RCTMessageThread.mm:45)
28 CoreFoundation 0x00000001a94ab924 CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK + 28 (CFRunLoop.c:1822)
29 CoreFoundation 0x00000001a95140ac __CFRunLoopDoBlocks + 368 (CFRunLoop.c:1864)
30 CoreFoundation 0x00000001a94e4508 __CFRunLoopRun + 2452 (CFRunLoop.c:3218)
31 CoreFoundation 0x00000001a94e91e4 CFRunLoopRunSpecific + 612 (CFRunLoop.c:3390)
32 MY_APP_NAME 0x00000001047bf398 +[RCTCxxBridge runRunLoop] + 264 (RCTCxxBridge.mm:378)
33 Foundation 0x00000001a3912ce8 NSThread__start + 716 (NSThread.m:968)
34 libsystem_pthread.dylib 0x00000001f5d916cc _pthread_start + 148 (pthread.c:893)
35 libsystem_pthread.dylib 0x00000001f5d90ba4 thread_start + 8
…
Expo: 45
Workflow: bare
eas-cli: 2.5.1
During search I tried to replace a lot of code in the AppDelegate.mm I found for this problem. Also from a freshly created and ejected Expo 45 example project.
When replacing almost the entire code from the App.tsx with a simple Text it works.
Furthermore, expo run:ios and npx expo start --no-dev --minify have also no problems.
I hope some of you have an idea how to solve this. I’m stuck on this Issue for some time now. If you need additional information, ask in the comments.
The problem was solved by enabling hermes in the Podfile with :hermes_enabled => true

An error was encountered while attempting to communicate with this device. (The service is invalid.)

I am using Mac OS 10.14.6 with Xcode 11.3.1 and with flutter when running the command flutter doctor -v everything is correct, the problem is that it does not let me compile because I am using iOS 15.4.1 download the OS version, so that could recognize, also use the following link:
The code signature version is no longer supported
to be able to solve a problem when compiling it that is: --generate-entitlement-der
but when I want to recompile it, it sends me the following error:
An error was encountered while attempting to communicate with this device. (The service is invalid.)
When verifying in more detail, it sends the following errors:
Details
An error was encountered while attempting to communicate with this device. (The service is invalid.)
Domain: com.apple.dtdevicekit
Code: -402653150
Failure Reason: Please try rebooting and reconnecting the device. (0xE8000022).
User Info: {
DVTRadarComponentKey = 487927;
"com.apple.dtdevicekit.stacktrace" = (
0 DTDeviceKitBase 0x00000001270f46e7 DTDKCreateNSError + 109
1 DTDeviceKitBase 0x00000001270f4de9 DTDK_AMDErrorToNSError + 792
2 DTDeviceKitBase 0x0000000127105d0c __63-[DTDKRemoteDeviceConnection startFirstServiceOf:unlockKeybag:]_block_invoke + 301
3 DTDeviceKitBase 0x00000001271054db __48-[DTDKRemoteDeviceConnection futureWithSession:]_block_invoke_3 + 22
4 DTDeviceKitBase 0x00000001270f715f __DTDKExecuteInSession_block_invoke_2 + 35
5 DTDeviceKitBase 0x00000001270f6593 __DTDKExecuteWithConnection_block_invoke_2 + 473
6 DTDeviceKitBase 0x00000001270f6391 __DTDKExecuteWithConnection_block_invoke + 106
7 libdispatch.dylib 0x00007fff7227963d _dispatch_client_callout + 8
8 libdispatch.dylib 0x00007fff72285129 _dispatch_lane_barrier_sync_invoke_and_complete + 60
9 DVTFoundation 0x000000010c9dc110 DVTDispatchBarrierSync + 208
10 DVTFoundation 0x000000010c9b3538 -[DVTDispatchLock performLockedBlock:] + 64
11 DTDeviceKitBase 0x00000001270f6292 DTDKExecuteWithConnection + 226
12 DTDeviceKitBase 0x00000001270f6fc9 DTDKExecuteInSession + 376
13 DTDeviceKitBase 0x0000000127105410 __48-[DTDKRemoteDeviceConnection futureWithSession:]_block_invoke_2 + 112
14 DVTFoundation 0x000000010c9d9e7a __DVT_CALLING_CLIENT_BLOCK__ + 7
15 DVTFoundation 0x000000010c9db552 __DVTDispatchAsync_block_invoke + 809
16 libdispatch.dylib 0x00007fff722785f8 _dispatch_call_block_and_release + 12
17 libdispatch.dylib 0x00007fff7227963d _dispatch_client_callout + 8
18 libdispatch.dylib 0x00007fff7227f8e0 _dispatch_lane_serial_drain + 602
19 libdispatch.dylib 0x00007fff72280396 _dispatch_lane_invoke + 385
20 libdispatch.dylib 0x00007fff722886ed _dispatch_workloop_worker_thread + 598
21 libsystem_pthread.dylib 0x00007fff724b9611 _pthread_wqthread + 421
22 libsystem_pthread.dylib 0x00007fff724b93fd start_wqthread + 13
);
}
--
In some forums I saw that changing the cable and/or port, I also did it cleaning the project and restarting the equipment but I still have the same error.
In some forums they also mentioned that it was due to trying to compile on a device with an iOS that does not support the version of xcode but I do not know if there is any solution since neither for

FirebaseApp.configure() crashes for unit test target

I've encountered a strange problem where the FirebaseApp.configure() call causes my app to instantly crash for my unit test target. It runs just fine for my standard builds.
Any ideas why this is happening?
Here's the stack trace:
2018-04-18 11:42:57.252405+0100 Avalanche[14289:124354] 4.8.1 - [Firebase/Analytics][I-ACS023007] Firebase Analytics v.40007000 started
2018-04-18 11:42:57.252454+0100 Avalanche[14289:124361] 4.8.1 - [Firebase/Core][I-COR000005] No app has been configured yet.
2018-04-18 11:42:57.252712+0100 Avalanche[14289:124354] 4.8.1 - [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://googl/RfcP7r)
2018-04-18 11:42:57.371588+0100 Avalanche[14289:124278] [Crashlytics] Version 3.9.3 (128)
2018-04-18 11:42:57.390507+0100 Avalanche[14289:124278] *** Terminating app due to uncaught exception 'FABException', reason: '[Fabric] Value of Info.plist key "Fabric" must be a NSDictionary.'
*** First throw call stack:
(
0 CoreFoundation 0x0000000113c0a1e6 __exceptionPreprocess + 294
1 libobjc.A.dylib 0x000000011329f031 objc_exception_throw + 48
2 CoreFoundation 0x0000000113c7f975 +[NSException raise:format:] + 197
3 Avalanche 0x000000010f654dec -[Fabric validFabricConfigFromInfoPlist:] + 353
4 Avalanche 0x000000010f654a16 -[Fabric fabricConfig] + 127
5 Avalanche 0x000000010f654bce -[Fabric APIKey] + 392
6 Avalanche 0x000000010f61e6d7 -[Crashlytics APIKey] + 55
7 Avalanche 0x000000010f62a087 -[CLSCrashReportingController APIKey] + 57
8 Avalanche 0x000000010f62977f -[CLSCrashReportingController startWithProfilingMark:betaToken:] + 257
9 Avalanche 0x000000010f61e088 __20-[Crashlytics start]_block_invoke + 637
10 libdispatch.dylib 0x0000000114b93779 _dispatch_client_callout + 8
11 libdispatch.dylib 0x0000000114b94c0a dispatch_once_f + 55
12 Avalanche 0x000000010f61de05 -[Crashlytics start] + 106
13 Avalanche 0x000000010f61e23a +[Crashlytics initializeIfNeeded] + 48
14 Avalanche Tests 0x0000000129cd440a __15+[Fabric with:]_block_invoke + 538
15 libdispatch.dylib 0x0000000114b93779 _dispatch_client_callout + 8
16 libdispatch.dylib 0x0000000114b94c0a dispatch_once_f + 55
17 Avalanche Tests 0x0000000129cd41ee +[Fabric with:] + 222
18 Avalanche Tests 0x0000000129cd5dea __14+[Fabric load]_block_invoke + 580
19 Foundation 0x0000000112cc0324 -[__NSObserver _doit:] + 298
20 CoreFoundation 0x0000000113ba5b8c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
21 CoreFoundation 0x0000000113ba5a65 _CFXRegistrationPost + 453
22 CoreFoundation 0x0000000113ba57a1 ___CFXNotificationPost_block_invoke + 225
23 CoreFoundation 0x0000000113b67422 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1826
24 CoreFoundation 0x0000000113b665a1 _CFXNotificationPost + 609
25 Foundation 0x0000000112c80e57 -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
26 Avalanche 0x000000010f6d41a7 +[FIRApp sendNotificationsToSDKs:] + 393
27 Avalanche 0x000000010f6d309e +[FIRApp configureDefaultAppWithOptions:sendingNotifications:] + 302
28 Avalanche 0x000000010f6d2eda +[FIRApp configure] + 380
29 Avalanche 0x000000010f609490 _T09Avalanche11AppDelegateCACycfc + 192
30 Avalanche 0x000000010f6094c3 _T09Avalanche11AppDelegateCACycfcTo + 19
31 UIKit 0x00000001109eb6c4 _UIApplicationMainPreparations + 1491
32 UIKit 0x00000001109eb087 UIApplicationMain + 111
33 Avalanche 0x000000010f60b447 main + 55
34 libdyld.dylib 0x0000000114c08955 start + 1
)
li
bc++abi.dylib: terminating with uncaught exception of type NSException
Before the crash, I also see a large number of log entries like:
objc[14289]: Class RCNKeyValue is implemented in both /Users/sammcneilly/Library/Developer/CoreSimulator/Devices/E62EC87E-0B07-4A83-A165-819E693AEB87/data/Containers/Bundle/Application/6C3F993F-4CEB-462F-9257-0F3C8E088BC0/Avalanche.app/Avalanche (0x10f7bdd50) and /Users/sammcneilly/Library/Developer/Xcode/DerivedData/Avalanche-ewiqmxxekhpknrhhfuyljlekgzat/Build/Products/Development-iphonesimulator/Avalanche.app/PlugIns/Avalanche Tests.xctest/Avalanche Tests (0x129e075d8). One of the two will be used. Which one is undefined.
I've installed Firebase and Firebase/Crashlytics via CocoaPods.
I'm not sure if this is related to Xcode 9.3 - this is happening on two separate projects, and I'm fairly certain it didn't happen previously for the older project.
I've printed out the bundle contents and the GoogleService-Info.plist file appears to be there.
Any help would be much appreciated!
Ok so this turned out to be caused by an incorrectly-configured Pod file.
My main target and unit test target were configured to use the following pods:
pod 'Crashlytics', '~> 3.10.1'
pod 'Fabric', '~> 1.7.6'
pod 'Firebase/Core', '~> 4.8'
pod 'FirebaseRemoteConfig', '~> 2.1'
Removing the additional Firebase pods for the test target ONLY (other than Firebase/Core) and running pod install again helped.
I'm not altogether sure why this worked, so would be very grateful if someone could explain this to me.
The "${PODS_ROOT}/Fabric/run" build phase script was configured on my primary target as detailed in Google's docs here: https://firebase.google.com/docs/crashlytics/get-started, and adding it to the test target didn't help either...
Thanks to everyone for their input, but adding the Fabric details manually to the Info.plist file just caused a build error. I believe this step is automatically handled for Firebase.
We had the same crash when running XCTest. We use the following to get around it.
if NSClassFromString("XCTest") != nil {
return true
} else {
FirebaseApp.configure()
}
Put this code in info.plist
<key>Fabric</key>
<dict>
<key>APIKey</key>
<string>YOUR APIKEY</string>
<key>Kits</key>
<array>
<dict>
<key>KitInfo</key>
<dict/>
<key>KitName</key>
<string>Crashlytics</string>
</dict>
</array>
</dict>
Hope it's helps.!

DTDeviceKit: Could not start house arrest service for app identifier XXX

I'm using Xcode 7.3.1 and executing XCTest via the command-line on my device, "iPhone 1", which is an iPhone 6 running iOS 9.3.5:
xcodebuild \
-scheme Todo \
-project Todo.xcodeproj \
-destination "platform=iOS,name=iPhone 1"\
clean build test
The build succeeded, however it failed after compiling the test files:
2016-09-13 14:51:32.604 xcodebuild[79689:2064116] DTDeviceKit: Could not start house arrest service for app identifier com.example.Todo [Error Domain=com.apple.dtdevicekit Code=-402653093 "Too many instances of this service are already running." UserInfo={NSLocalizedFailureReason=Too many instances of this service are already running., com.apple.dtdevicekit.stacktrace=(
0 DTDeviceKitBase 0x000000010fead3cb DTDKCreateNSError + 113
1 DTDeviceKitBase 0x000000010feadb09 DTDK_AMDErrorToNSError + 791
2 DTDeviceKitBase 0x000000010febf2f5 __70-[DTDKRemoteDeviceConnection startHouseArrestServiceForAppIdentifier:]_block_invoke + 100
3 DTDeviceKitBase 0x000000010febe1d1 __48-[DTDKRemoteDeviceConnection futureWithSession:]_block_invoke_4 + 22
4 DTDeviceKitBase 0x000000010feb0317 __DTDKExecuteInSession_block_invoke + 38
5 DTDeviceKitBase 0x000000010feaf940 __DTDKExecuteWithConnection_block_invoke_2 + 477
6 DTDeviceKitBase 0x000000010feaf73c __DTDKExecuteWithConnection_block_invoke + 107
7 libdispatch.dylib 0x00007fff99bda40b _dispatch_client_callout + 8
8 libdispatch.dylib 0x00007fff99bdb9f2 _dispatch_barrier_sync_f_invoke + 74
9 DVTFoundation 0x0000000106400bef DVTDispatchBarrierSync + 206
10 DVTFoundation 0x00000001063dd59b -[DVTDispatchLock performLockedBlock:] + 116
11 DTDeviceKitBase 0x000000010feaf646 DTDKExecuteWithConnection + 223
12 DTDeviceKitBase 0x000000010feb02a1 DTDKExecuteInSession + 121
13 DTDeviceKitBase 0x000000010febe108 __48-[DTDKRemoteDeviceConnection futureWithSession:]_block_invoke_3 + 117
14 DVTFoundation 0x00000001063fff4b __DVTDispatchAsync_block_invoke + 827
15 libdispatch.dylib 0x00007fff99be593d _dispatch_call_block_and_release + 12
16 libdispatch.dylib 0x00007fff99bda40b _dispatch_client_callout + 8
17 libdispatch.dylib 0x00007fff99becbd7 _dispatch_async_redirect_invoke + 1733
18 libdispatch.dylib 0x00007fff99bda40b _dispatch_client_callout + 8
19 libdispatch.dylib 0x00007fff99bde29b _dispatch_root_queue_drain + 1890
20 libdispatch.dylib 0x00007fff99bddb00 _dispatch_worker_thread3 + 91
21 libsystem_pthread.dylib 0x00007fff9b5d94de _pthread_wqthread + 1129
22 libsystem_pthread.dylib 0x00007fff9b5d7341 start_wqthread + 13
), NSLocalizedRecoverySuggestion=Too many instances of this service are already running., NSLocalizedDescription=Too many instances of this service are already running.}]
2016-09-13 14:51:32.918 xcodebuild[79689:2063388] Error Domain=IDETestOperationsObserverErrorDomain Code=5 "Early unexpected exit, operation never finished bootstrapping - no restart will be attempted" UserInfo={NSLocalizedDescription=Early unexpected exit, operation never finished bootstrapping - no restart will be attempted}
Running the tests in Xcode did not succeed either. And it always fails with the errors described in these posts:
dyld: could not load inserted library
Xcode 7.0 XCTest dyld: could not load inserted library IDEBundleInjection
I've tried the solutions suggested in the posts (i.e. fix provisioning profile and code signing), but it did not help. Has anyone faced similar problems?
I was trying to find out if DTDeviceKit was running on my machine, but it did not. My next suspicion was that it could be running on the phone.
After rebooting my phone, it works.
I filed a technical support ticket with apple. Turns out it's a bug which affects 32 bit devices. So if you test on a 64 bit device you won't have this issue.

Xcode crashes on launch

I am developing an Application for iOS and I changed nothing in the Application. But at a restart of my Mac, Xcode crashes every time.
Don't know if this is important, but my spotlight can't find any applications and also when I open the finder and using the shortcut cmd + shift + H I see a white window.
Xcode isn't starting anymore and throws this error:
Process: Xcode [1346]
Path: /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier: com.apple.dt.Xcode
Version: 7.2 (9548)
Build Info: IDEFrameworks-9548000000000000~7
App Item ID: 497799835
App External ID: 814662604
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Xcode [1346]
Date/Time: 2015-12-24 11:01:44.753 +0100
OS Version: Mac OS X 10.11.2 (15C50)
Report Version: 11
Time Awake Since Boot: 4000 seconds
System Integrity Protection: enabled
Crashed Thread: 4 Dispatch queue: DVTFilePathEventWatcher - event queue
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
VM Regions Near 0:
-->
__TEXT 0000000108a5a000-0000000108a5e000 [ 16K] r-x/rwx SM=COW /Applications/Xcode.app/Contents/MacOS/Xcode
Application Specific Information:
ProductBuildVersion: 7C68
Thread 0:: Dispatch queue: DVTFilePath cache derivation lock for key DVTFilePathKey_SortedDirectoryContents
0 libobjc.A.dylib 0x00007fff8df27aa0 search_method_list(method_list_t const*, objc_selector*) + 2
1 libobjc.A.dylib 0x00007fff8df28d76 lookUpImpOrForward + 413
2 libobjc.A.dylib 0x00007fff8df22591 objc_msgSend + 209
3 com.apple.dt.DVTFoundation 0x0000000108a741f8 -[DVTFileSystemVNode addCachedEntriesFromDictionary:] + 215
4 com.apple.dt.DVTFoundation 0x0000000108bd2e2d __33-[DVTFilePath cachedValueForKey:]_block_invoke549 + 245
5 libdispatch.dylib 0x00007fff9fcbd33f _dispatch_client_callout + 8
6 libdispatch.dylib 0x00007fff9fcbe926 _dispatch_barrier_sync_f_invoke + 74
7 com.apple.dt.DVTFoundation 0x0000000108cd1005 DVTDispatchBarrierSync + 62
8 com.apple.dt.DVTFoundation 0x0000000108a69627 -[DVTDispatchLock performLockedBlock:] + 116
9 com.apple.dt.DVTFoundation 0x0000000108a715b0 -[DVTFilePath cachedValueForKey:] + 1802
10 com.apple.dt.DVTFoundation 0x0000000108a70afc -[DVTToolchainRegistry scanSearchPathAndRegisterToolchains:] + 563
11 com.apple.dt.IDEFoundation 0x00000001097d1a66 IDEInitialize + 655
12 com.apple.dt.IDEKit 0x0000000109ecdf7c -[IDEApplicationController applicationWillFinishLaunching:] + 708
13 com.apple.CoreFoundation 0x00007fffa18fa70c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
14 com.apple.CoreFoundation 0x00007fffa18fa67f ___CFXRegistrationPost_block_invoke + 63
15 com.apple.CoreFoundation 0x00007fffa18f9d47 _CFXRegistrationPost + 407
16 com.apple.CoreFoundation 0x00007fffa18f9ab2 ___CFXNotificationPost_block_invoke + 50
17 com.apple.CoreFoundation 0x00007fffa18f3d42 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1922
18 com.apple.CoreFoundation 0x00007fffa17e2145 _CFXNotificationPost + 693
19 com.apple.Foundation 0x00007fff9ef36921 -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
20 com.apple.dt.DVTFoundation 0x0000000108c6cf55 -[NSNotificationCenter(DVTNSNotificationCenterAdditions) _dvt_postNotificationName:object:userInfo:] + 698
21 com.apple.AppKit 0x00007fff9db412c2 -[NSApplication finishLaunching] + 354
22 com.apple.dt.DVTKit 0x0000000109275f62 -[DVTApplication finishLaunching] + 149
23 com.apple.AppKit 0x00007fff9db40e05 -[NSApplication run] + 231
24 com.apple.AppKit 0x00007fff9dac3520 NSApplicationMain + 1176
25 libdyld.dylib 0x00007fff9a8605ad start + 1
Could this be an issue due to Permissions conflicts?
ANSWER:
After I changed the rights from my OSX-Drive to everyone can write&read. Everything worked. But I knew that this is a temporary solution, so I decided to reinstall my MAC and everything was fine.
Delete ~/Library/Developer/Xcode/DerivedData by running this command in terminal:
rm -r ~/Library/Developer/XCode/DerivedData
If that doesnt work, At this point and with given info, all I could recommend to delete and reinstall Xcode.
If the delete of ~/Library/Developer/Xcode/DerivedData is not working for you, try this steps to remove xcuserdata:
open a Finder window and navigate to your project
right-click on the .xcodeproj OR .xcworkspace file
select Show Package Contents
a new window appears
delete a folder called xcuserdata
I had one where i selected a file that was quite large which crashed xcode when it tried to parse it. Then when i restarted it somehow it got set to load that file on start. Only way i saw was to temporarily rename the file that it was trying to load at start so it would load empty.
I'll recommend deleting xcuserdata: folder from both of your .xcodeproj & .xcworkspace file (open with Show Package Contents) and try again.
I hope this will work.
Ensure there are no issues with your SPM packages/dependencies.
This is simply another suggestion. I just spent some time debugging this on a fairly popular open source project.
My Xcode first crashed when I updated a SPM package, so I was fairly certain it was an issue with one of the future commits in that package or a SPM bug. I subscribe to Occam's Razor, so I started going through the changes in the commits.
After some time, I found a duplicate Swift Playground page delcaration in contents.xcplayground. I removed that single line, pushed the PR, and everything worked fine after that.
To be able to reopen the project:
Open project.pbxproj in your code editor of choice (e.g. vi, nano, emacs, atom, code).
Remove the offending package or packages from the /* Begin XCRemoteSwiftPackageReference section */ and /* Begin XCSwiftPackageProductDependency section */ sections.
Save the file and Xcode should now open.
Again, if your Xcode is immediately crashing when opening a project (and you last updated/auto-updated a SPM package) go through your packages.

Resources