I recently submitted an app update to the App Store. The app runs well in Xcode (on device and simulator) for all versions of iOS including iOS 13+. I was surprised that it was rejected for crashing at startup. I checked using a Testflight build and it only crashed when ran on a device with iOS 13+. I could not replicate crashes from Xcode as it only crashes on the builds from Tesflight.
I've been researching online and see that this is not an uncommon issue, however, I can't identify what's the issue in my case. I've tried changing the build settings in Xcode and building from an older version of Xcode (10.2.1, doesn't work bc I use newer classes not compatible with anything lower than Xcode 11). I also tried changing the swift compiler optimization level to zero in the build settings. To upload a build to Tesflight, I am exporting the archive and uploading to iTunes Connect using Apple's Transporter app.
Using the crash log and podfile description below, can anyone identify the issue and/or make a suggestion on what's going wrong in the build.
Crash Log
OS Version: iPhone OS 13.2.3 (17B111)
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
libsystem_kernel.dylib 0x00000001baaf7ec4 __pthread_kill + 8
libsystem_pthread.dylib 0x00000001baa13774 pthread_kill$VARIANT$mp + 112
libsystem_c.dylib 0x00000001ba967844 abort + 100
libc++abi.dylib 0x00000001baac07d4 __cxa_bad_cast + 0
libc++abi.dylib 0x00000001baac09c4 demangling_unexpected_handler+ 6596 () + 0
libobjc.A.dylib 0x00000001baa28258 _objc_terminate+ 25176 () + 124
libc++abi.dylib 0x00000001baacd304 std::__terminate(void (*)+ 58116 ()) + 16
libc++abi.dylib 0x00000001baacd29c std::terminate+ 58012 () + 44
libdispatch.dylib 0x00000001ba9cd198 _dispatch_client_callout + 36
libdispatch.dylib 0x00000001ba975fd8 _dispatch_block_invoke_direct$VARIANT$mp + 224
FrontBoardServices 0x00000001bfe4e4c8__FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 40
FrontBoardServices 0x00000001bfe4e194 -[FBSSerialQueue _queue_performNextIfPossible] + 404
FrontBoardServices 0x00000001bfe4e6bc -[FBSSerialQueue _performNextFromRunLoopSource] + 28
CoreFoundation 0x00000001bac7d7c4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
CoreFoundation 0x00000001bac7d71c __CFRunLoopDoSource0 + 80
CoreFoundation 0x00000001bac7ceb4 __CFRunLoopDoSources0 + 180
CoreFoundation 0x00000001bac78000 __CFRunLoopRun + 1080
CoreFoundation 0x00000001bac778a0 CFRunLoopRunSpecific + 464
GraphicsServices 0x00000001c4bcf328 GSEventRunModal + 104
UIKitCore 0x00000001bed68740 UIApplicationMain + 1936
OnStation 0x0000000100a553ac main + 103340 (main.m:14)
libdyld.dylib 0x00000001bab02360 start + 4
Podfile
pod 'AWSCore'
pod 'AWSSNS'
pod 'AWSS3'
pod 'AWSCognito'
pod 'AWSCognitoIdentityProvider'
pod 'AWSCognitoSync'
pod 'AWSDynamoDB'
pod 'Flurry-iOS-SDK/FlurrySDK'
pod 'ArcGIS-Runtime-SDK-iOS', '100.2.1'
pod 'SVProgressHUD'
pod 'UICKeyChainStore'
pod 'RangeSeekSlider'
pod 'PubNub', '~> 4'
pod 'MessageKit'
I’m going to guess that this is due to a situation parallel to
iOS11 WKWebview crash due to NSInvalidUnarchiveOperationException
In other words, I'm guessing that you have something in your storyboard that comes from another framework that you need to link explicitly. That sort of thing often doesn’t crash from Xcode but does crash when launching independently.
Related
Ever since Xcode 11 I've not been able to run any apps on my device. They will launch in the simulator just fine. I have an iPhone 11 Max Pro.
I've tried everything I can think of to get it to work and I have no idea what to do at this point. Has anyone figured out a fix ?
I did try setting my project to Legacy build and I still have the same issue.
Here are the details of the failed install to my iPhone.
Details
Unable to install "App Test"
Domain: com.apple.dtdevicekit
Code: -402620395
--
App installation failed
Domain: com.apple.dtdevicekit
Code: -402620395
Failure Reason: A valid provisioning profile for this executable was not found.
User Info: {
DVTRadarComponentKey = 487927;
"com.apple.dtdevicekit.stacktrace" = (
0 DTDeviceKitBase 0x00000001251586e7 DTDKCreateNSError + 109
1 DTDeviceKitBase 0x0000000125158de9 DTDK_AMDErrorToNSError + 792
2 DTDeviceKitBase 0x000000012519856a __90-[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:]_block_invoke + 164
3 DVTFoundation 0x000000010b27cc22 DVTInvokeWithStrongOwnership + 73
4 DTDeviceKitBase 0x0000000125198301 -[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:] + 1589
5 IDEiOSSupportCore 0x0000000125020a25 __118-[DVTiOSDevice(DVTiPhoneApplicationInstallation) processAppInstallSet:appUninstallSet:installOptions:completionBlock:]_block_invoke.352 + 4523
6 DVTFoundation 0x000000010b3ade8a __DVT_CALLING_CLIENT_BLOCK__ + 7
7 DVTFoundation 0x000000010b3af562 __DVTDispatchAsync_block_invoke + 809
8 libdispatch.dylib 0x00007fff6d6ca583 _dispatch_call_block_and_release + 12
9 libdispatch.dylib 0x00007fff6d6cb50e _dispatch_client_callout + 8
10 libdispatch.dylib 0x00007fff6d6d0ace _dispatch_lane_serial_drain + 597
11 libdispatch.dylib 0x00007fff6d6d1452 _dispatch_lane_invoke + 363
12 libdispatch.dylib 0x00007fff6d6daa9e _dispatch_workloop_worker_thread + 598
13 libsystem_pthread.dylib 0x00007fff6d9256fc _pthread_wqthread + 290
14 libsystem_pthread.dylib 0x00007fff6d924827 start_wqthread + 15
);
}
--
I faced this issue today and I could not fix it either with the proposed solutions that are out there, because they pointed into the wrong direction.
Do you, by any chance, have frameworks included in your project and set them to "embed without signing"? Changing the included frameworks to "embed & sign" fixed this issue for me.
Not properly re-signing external frameworks seems to cause problems when attempting to install the binary to a real device. The executable mentioned in "A valid provisioning profile for this executable was not found." does in this context refer to the insufficiently signed external framework.
While checking Xcode 8.2 changes I found that now we can record simulator using Terminal.
So I am trying to record video from iOS simulator as describe in this Apple Document.
Taking a Screenshot or Recording a Video Using the Command Line
Command:
xcrun simctl io booted recordVideo demoVideo.mp4
Error:
2016-12-20 15:44:27.206 simctl[6434:984477] *** Assertion failure in +[SimDisplayVideoWriter videoWriter], /BuildRoot/Library/Caches/com.apple.xbs/Sources/CoreSimulator/CoreSimulator-338.16/SimulatorKit/SimDisplayVideoWriter.m:48
2016-12-20 15:44:27.207 simctl[6434:984477] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Failed to create metal device for video writer.'
*** First throw call stack:
(
0 CoreFoundation 0x00007fffa07f90db __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00007fffb548ba2a objc_exception_throw + 48
2 CoreFoundation 0x00007fffa07fdc32 +[NSException raise:format:arguments:] + 98
3 Foundation 0x00007fffa2266d50 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195
4 SimulatorKit 0x000000010a248c53 +[SimDisplayVideoWriter videoWriter] + 1015
5 SimulatorKit 0x000000010a2499e5 +[SimDisplayVideoWriter videoWriterForURL:fileType:] + 316
6 simctl 0x000000010a168a00 simctl + 31232
7 simctl 0x000000010a166bee simctl + 23534
8 simctl 0x000000010a170d52 simctl + 64850
9 libdispatch.dylib 0x00007fffb5d3fef7 _dispatch_call_block_and_release + 12
10 libdispatch.dylib 0x00007fffb5d370b8 _dispatch_client_callout + 8
11 libdispatch.dylib 0x00007fffb5d39029 _dispatch_root_queue_drain + 917
12 libdispatch.dylib 0x00007fffb5d38c47 _dispatch_worker_thread3 + 99
13 libsystem_pthread.dylib 0x00007fffb5f84712 _pthread_wqthread + 1299
14 libsystem_pthread.dylib 0x00007fffb5f841ed start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Abort trap: 6
iOS simulator and application both working properly. This error only shown in Terminal.
I am using Xcode 8.2. Tried in Simulator of iPhone 7, 7 Plus, SE with iOS 10.2.
Am I missing any detail or need to install and component?
Video recording is only supported on Macs that support Metal. If your system doesn't support metal, you will see an abort with that message. Yeah, we should make that error message more user friendly.
To see a list of supported systems, you can check out https://support.apple.com/en-us/HT205073
this was also fixed in Xcode 8.3 Beta: http://adcdownload.apple.com/Developer_Tools/Xcode_8.3_beta/Release_Notes_for_Xcode_8.3_beta.pdf
• Videos recorded by the simctl tool of the xcrun command line tool now support scrubbing and import into video editors correctly. (29654098)
I did not test this currently but it is quite possible that in stable version of Xcode this bug will be fixed
I upgraded to XCode 8, and I am going through hell of being able to run my tests sometimes... For example, I just was testing some code, and was able to run my tests 3 times in a row... and then the 4th time I got:
dyld: could not load inserted library 'PLATFORMS/iPhoneOS.platform/Developer/Library/PrivateFrameworks/IDEBundleInjection.framework/IDEBundleInjection' because image not found
*** If you believe this error represents a bug, please attach the log file at /Users/patrick/Library/Developer/Xcode/DerivedData/MyApp-hjfppqmgxqrprucknvwtakynpqxs/Logs/Test/2B6C2EAE-5C13-40C9-BACE-3A00AA74F3EF/Session-UnitTests-2016-09-20_124123-gk3pW0.log
I have rebooted my iOS device, rebooted my computer, deleted derrived data, etc... It will no longer run tests. ARRRGH!!!!
UPDATE
I should mention, I am trying to run tests on my iPad, I can't run tests on the simulator because I have too much code having to do with NEON intrinsics, and so the simulator wont run.
But what does seem to work is, when this happens, switch to build tests on my iPhone, then it when it builds, it just says "running tests" and the spinner spins forever, but no tests are actually running... I can actually tap on my app and interact with it, which is usually not the behavior I get when running tests... Anyway I then stopped the build, switched back to my iPad and now tests run again.
I get this error consistently with XCode 8.0 running on my iPad (Version 10.0.2 (14A456)) when I run test code that causes an uncaught exception in the code under test. There may be other examples, but it happens any time the code under test fails catastrophically.
When the unit test fails with an exception, XCode does not recover properly.
I believe this is a problem with XCode; this answer provides a workaround. The unit test will fail at the exception, and subsequent runs produce the 'image not found' error.
The simplest recovery I've found is the following:
Set device target to Generic iOS Device
Disconnect my iPad
Reboot the iPad
Connect everything back together
Here is an example failure that demonstrates the problem;
Notice that the core issue in this example is that I have written a bad unit test; I'm passing a nil parameter to a method that is subsequently used to try adding a nil object to a dictionary.
Update: for the sake of accuracy, the issue was that I was passing an immutable dictionary as a parameter when a mutable one was expected, thus producing the 'unrecognized selector' error. In any case, the exception is what causes XCode to behave badly.
Assertions: failed: caught "NSInvalidArgumentException", "-[__NSDictionaryI setObject:forKey:]: unrecognized selector sent to instance 0x1818f200"
(
0 CoreFoundation 0x1dd89e1f <redacted> + 154
1 libobjc.A.dylib 0x1cfef077 objc_exception_throw + 38
2 CoreFoundation 0x1dd8f515 <redacted> + 0
3 CoreFoundation 0x1dd8d589 <redacted> + 700
4 CoreFoundation 0x1dcb2f08 _CF_forwarding_prep_0 + 24
5 tDefense 0x000cd299 +[PlayingPiece addPlayingPiece:atLocation:onBoard:] + 326
6 tDefense 0x000cd5ad +[PlayingPiece addNewPiece:atLocation:onBoard:] + 154
7 tDefenseTests 0x00410777 -[PlayFieldTests testGetNeighbors] + 4594
8 CoreFoundation 0x1dd8e864 <redacted> + 68
9 CoreFoundation 0x1dcaf349 <redacted> + 294
10 XCTest 0x00307de5 __24-[XCTestCase invokeTest]_block_invoke_2 + 472
11 XCTest 0x0033b0dd -[XCTestContext performInScope:] + 312
12 XCTest 0x00307c07 -[XCTestCase invokeTest] + 296
13 XCTest 0x00308439 -[XCTestCase performTest:] + 560
14 XCTest 0x0030578d -[XCTestSuite performTest:] + 520
15 XCTest 0x0030578d -[XCTestSuite performTest:] + 520
16 XCTest 0x0030578d -[XCTestSuite performTest:] + 520
17 XCTest 0x002f1d55 __25-[XCTestDriver _runSuite]_block_invoke + 52
18 XCTest 0x00312325 -[XCTestObservationCenter _observeTestExecutionForBlock:] + 628
19 XCTest 0x002f1bed -[XCTestDriver _runSuite] + 512
20 XCTest 0x002f29b7 -[XCTestDriver _checkForTestManager] + 300
21 XCTest 0x0033c55b _XCTestMain + 690
22 CoreFoundation 0x1dd45bc3 <redacted> + 10
23 CoreFoundation 0x1dd455a7 <redacted> + 230
24 CoreFoundation 0x1dd43a61 <redacted> + 752
25 CoreFoundation 0x1dc93073 CFRunLoopRunSpecific + 486
26 CoreFoundation 0x1dc92e81 CFRunLoopRunInMode + 104
27 GraphicsServices 0x1f43bbfd GSEventRunModal + 156
28 UIKit 0x22e34acf <redacted> + 574
29 UIKit 0x22e2f201 UIApplicationMain + 150
30 tDefense 0x000d690f main + 106
31 libdyld.dylib 0x1d45e50b <redacted> + 2
)
File: <unknown>
I was having exactly the same problem after upgrading to Xcode 8 / Swift 2.3. One of deleting derived data, rebooting the phone and closing and re-opening Xcode just fixed it.
Got the new Retina MacBook and it has not been playing nice with xCode. If i make a new project it works, but if i ty triggering the assistant editor it will freeze. If i save a new project and reopen it, it will freeze. I did install the 4.5 DP and uninstalled it and the latest nonbeta version of xcode and the problem still persists. Anyone know what could be the issue? If i make a new user account xcode is behaving normally. Anyone know of a fix? Crash large too large for me to post.
Date/Time: 2012-06-30 03:10:29 -0700
OS Version: 10.7.4 (Build 11E2620)
Architecture: x86_64
Report Version: 9
Command: Xcode
Path: /Applications/Xcode.app/Contents/MacOS/Xcode
Version: 4.3.3 (1178)
Build Version: 3
Project Name: IDEApplication
Source Version: 1178000000000000
App Item ID: 497799835
App External ID: 8553856
Parent: launchd [111]
PID: 234
Event: hang
Duration: 1.76s
Steps: 18 (100ms sampling interval)
Pageins: 44
Pageouts: 0
Process: Xcode [234]
Path: /Applications/Xcode.app/Contents/MacOS/Xcode
Architecture: x86_64
UID: 501
Thread 0x810 DispatchQueue 1
User stack:
18 ??? (in Xcode) [0x107b73eec]
18 NSApplicationMain + 867 (in AppKit) [0x7fff85edf244]
18 -[NSApplication run] + 555 (in AppKit) [0x7fff85c630c6]
18 -[IDEApplication sendEvent:] + 366 (in IDEKit) [0x1085c2dd1]
18 -[NSApplication sendEvent:] + 4282 (in AppKit) [0x7fff85ccc536]
18 -[NSApplication _handleKeyEquivalent:] + 526 (in AppKit) [0x7fff85dd3175]
18 -[NSMenu performKeyEquivalent:] + 281 (in AppKit) [0x7fff85dd4524]
18 -[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] + 125 (in AppKit) [0x7fff85e56932]
18 -[NSMenuItem _corePerformAction] + 399 (in AppKit) [0x7fff85e56bfb]
18 -[IDEApplication sendAction:to:from:] + 154 (in IDEKit) [0x1085c7096]
18 -[DVTApplication sendAction:to:from:] + 318 (in DVTKit) [0x107e76866]
18 -[NSApplication sendAction:to:from:] + 139 (in AppKit) [0x7fff85d69f7e]
18 -[NSObject performSelector:withObject:] + 61 (in CoreFoundation) [0x7fff8a15270d]
18 -[IDEWorkspaceTabController _changeToEditorMode:] + 361 (in IDEKit) [0x108728088]
18 _NSSetIntValueAndNotify + 259 (in Foundation) [0x7fff86f8353f]
18 -[IDEEditorArea setEditorMode:] + 384 (in IDEKit) [0x108604a61]
18 -[IDEEditorArea _refreshEditorContextsAndPreserveCurrentEditorHistoryStack:] + 642 (in IDEKit) [0x108604d8e]
18 +[DVTLayoutView_ML _recursivelyLayoutSubviewsOfView:populatingSetWithLaidOutViews:] + 108 (in DVTKit) [0x107e858ec]
18 +[DVTLayoutView_ML
For me, the solution was simple:
Close Xcode
Delete the following folders/files from myProject.xcodeproj (or .xcworkspace if you're using cocoapods) (right click on the file and choose “Show Package Contents”)
/xcuserdata
/project.xcworkspace
Reopen Xcode and enjoy
The crash is occurring due to a corruption in project's userdata content.
Also, you should note that after deleting those files, the window size and position will reset and the opened tabs will be all closed.
I experienced similar problems on my Retina MacBook. The workaround is to specify "Open in Low Resolution" for Xcode in the Finder. From http://support.apple.com/kb/HT5266:
Quit the application if it is currently open.
In the Finder, choose Applications from the Go menu.
In the Applications folder that opens, click the application's icon so it is highlighted.
Choose Get Info from the File menu.
Place a checkmark next to "Open in Low Resolution" to enable Low Resolution mode.
Close the window and double click the Application to reopen it.
This does have an impact on text quality, though it's not awful (subjective). Hopefully Apple will update Xcode soon.
I am facing the same problem .... I solve it after make changes as per screenshot -
it works for me.
I tried to run the phonon example code, Music player Example, came with the sdk. It runs well on Windows, but crashes while starting on Mac OS Snow Leopard 10.6.8. This is the crash details:
crash line:
audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
crash log and call stack:
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0×0000000000000008
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Thread 0 Crashed: Dispatch queue: com.apple.main-thread
0 QtCore 0×0000000100e9c8f2 QObject::moveToThread(QThread*) + 34
1 QtDBus 0×00000001010b4912 _q_sessionBus() + 162
2 QtDBus 0×00000001010b4a71 QDBusConnection::sessionBus() + 17
3 phonon 0×000000010001beab Phonon::FactoryPrivate::FactoryPrivate() + 219
4 phonon 0×000000010001edc2 Phonon::Factory::registerFrontendObject(Phonon::MediaNodePrivate*) + 146
5 phonon 0×0000000100028f92 Phonon::MediaNodePrivate::MediaNodePrivate(Phonon::MediaNodePrivate::CastId) + 82
6 phonon 0×00000001000137bf Phonon::AudioOutput::AudioOutput(Phonon::Category, QObject*) + 63
7 com.yourcompany.qmusicplayer 0×00000001000026cc MainWindow::MainWindow() + 108
8 com.yourcompany.qmusicplayer 0×00000001000024a2 main + 114
9 com.yourcompany.qmusicplayer 0×0000000100002404 start + 52
I believe that this was a problem with Qt 4.8.0. It required dbus to be installed on your machine. There are workarounds like installing dbus on your machine or rebuilding Qt with a patch, but I believe it's fixed in Qt 4.8.1 so probably just use that.