Xcode crashes when trying to make a UI test that involves a webview - swift

Working on building an automatic UI test for a swift iOS app. The app involves a web-view for logging in with facebook. Every time tap within the bounds of the web-view and try to log into facebook it crashes Xcode if I am attempting to build the UI test using the built in Xcode UI recording. It does not matter if I use my iPhone 6 or a simulator, no matter what Xcode will crash.
I am using Xcode 9. And the FBSDKLoginKit and FBSDKCoreKit.
Steps to reproduce:
1) Have an app with a webview
2) Hit record UI test
3) Click anywhere within the bounds of the webview
Is there a reason for this behavior?
Are there settings in Xcode I need to change in order to record web-view interactions?
Below is the error message I get when Xcode crashes.
Process: Xcode [70544]
Path: /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier: com.apple.dt.Xcode
Version: 9.3 (14154)
Build Info: IDEFrameworks-14154000000000000~2
App Item ID: 497799835
App External ID: 826408812
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Xcode [70544]
User ID: 501
Date/Time: 2018-05-21 14:04:50.053 -0400
OS Version: Mac OS X 10.13.4 (17E199)
Report Version: 12
Anonymous UUID: 335CE1E7-B5AB-F717-E6D0-019AF52B3708
Sleep/Wake UUID: 7824F1AB-C514-4609-A447-F15EA9C86C84
Time Awake Since Boot: 99000 seconds
Time Since Wake: 1800 seconds
System Integrity Protection: enabled
Crashed Thread: 18 Dispatch queue: XCUIRecorder_iOS.processingQueue
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Application Specific Information:
ProductBuildVersion: 9E145
UNCAUGHT EXCEPTION (NSInternalInconsistencyException): First snapshot has type Other: Other, 0x7f9d8c64aaf0, {{0.0, 0.0}, {0.0, 0.0}}
UserInfo: (null)
Hints:
Backtrace:
0 __exceptionPreprocess (in CoreFoundation)
1 DVTFailureHintExceptionPreprocessor (in DVTFoundation)
2 objc_exception_throw (in libobjc.A.dylib)
3 +[NSException raise:format:arguments:] (in CoreFoundation)
4 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] (in Foundation)
5 +[XCUIRecorderNodeFinder nodeToFindElementForSnapshots:language:platform:] (in XCTest)
6 -[XCUIRecorderUtilities nodeToFindElementForSnapshots:] (in XCTest)
7 __177-[XCUIRecorder_iOS _XCT_recordedEventNames:timestamp:duration:startLocation:startElementSnapshot:startApplicationSnapshot:endLocation:endElementSnapshot:endApplicationSnapshot:]_block_invoke (in XCTest)
8 _dispatch_call_block_and_release (in libdispatch.dylib)
9 _dispatch_client_callout (in libdispatch.dylib)
10 _dispatch_queue_serial_drain (in libdispatch.dylib)
11 _dispatch_queue_invoke (in libdispatch.dylib)
12 _dispatch_root_queue_drain_deferred_wlh (in libdispatch.dylib)
13 _dispatch_workloop_worker_thread (in libdispatch.dylib)
14 _pthread_wqthread (in libsystem_pthread.dylib)
15 start_wqthread (in libsystem_pthread.dylib)
ëØ$ïˇˇ
abort() called
Application Specific Signatures:
NSInternalInconsistencyException

This seems like an Xcode bug to me. You can report it on the Apple Bug Reporter.

Related

How to resolve unit test crash when code coverage is enabled on Xcode 11.4

We are getting a crash after excuting all unit tests when code coverage is enabled. Please find the stack trace below
Crashed Thread: 0 ReceiverMainThread Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: EXC_I386_GPFLT
Exception Note: EXC_CORPSE_NOTIFY
Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [41136]
Application Specific Information:
CoreSimulator 704.12 - Device: iPad Pro (12.9-inch) (3rd generation) (C0064E72-B310-4A5B-82BE-BCC12D3E4D46) - Runtime: iOS 13.4 (17E255) - DeviceType: iPad Pro (12.9-inch) (3rd generation)
Thread 0 Crashed:: ReceiverMainThread Dispatch queue: com.apple.main-thread
0 com.ios.Dev 0x000000010ea6f368 initializeValueProfRuntimeRecord + 56
1 com.ios.Dev 0x000000010ea733aa writeOneValueProfData + 170
2 com.ios.Dev 0x000000010ea7323b lprofWriteDataImpl + 683
3 com.ios.Dev 0x000000010ea72f7d lprofWriteData + 109
4 com.ios.Dev 0x000000010ea7151a writeFile + 714
5 com.ios.Dev 0x000000010ea7118f __llvm_profile_write_file + 1007
6 libsystem_c.dylib 0x00007fff51a65a38 __cxa_finalize_ranges + 326
7 libsystem_c.dylib 0x00007fff51a65d56 exit + 48
8 com.apple.dt.XCTest 0x00000001124ea721 _XCTestMain + 2709
9 libXCTestBundleInject.dylib 0x000000011138abfa __RunTests_block_invoke_2 + 13
10 com.apple.CoreFoundation 0x00007fff23da1a9c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
11 com.apple.CoreFoundation 0x00007fff23da1193 __CFRunLoopDoBlocks + 195
12 com.apple.CoreFoundation 0x00007fff23d9bf83 __CFRunLoopRun + 995
13 com.apple.CoreFoundation 0x00007fff23d9b884 CFRunLoopRunSpecific + 404
14 com.apple.GeoServices 0x00007fff38b5ac1a GSEventRunModal + 139
15 com.apple.UIKitCore 0x00007fff48c19220 UIApplicationMain + 1605
16 com.ios.Dev 0x000000010e7be223 main + 430 (main.m:125)
17 libdyld.dylib 0x00007fff519b910d start + 1
This crash is only happening on XCode 11.4, if code coverage is enabled. If code coverage is disabled it works fine, but we want the code coverage after executing unit tests. In Xcode 11.3 unit tests were executing fine with the code coverage enabled. Could any one please let us know the solution for this issue. Thanks in advance.
Edit:Resolution
For us changing the Macho-O-Type of one of the dependencies from Relocatable Object File to Static Library solved the issue. But not sure if this is the only cause for this issue as there might be multiple reasons.
I have exactly the same issue, and I'm still suffering in the Xcode 11.4.1.
I saw also you #Arjuna posting in the Apple developer forum:
https://forums.developer.apple.com/thread/131988
I didn't find any solution so far, but I think that this is related to the features introduced in the Xcode 11.4
https://developer.apple.com/documentation/xcode_release_notes/xcode_11_4_release_notes
Following the Releases Notes we have:
When building a scheme that has been converted to use test plans and whose active test plan has code coverage enabled, Xcode now includes code coverage instrumentation when building for the ‘Run’ action, in addition to the ‘Test’ action. This matches the behavior of building schemes which don’t use test plans and have code coverage enabled, and avoids unnecessary rebuilds when alternating between running and testing actions. (57367856)
I'm pretty sure that somehow is related to this, but I'm still no able to find a way to fix it.
try to disable code coverage. it helps in my case
Try with disabled main thread checker

iOS-App crashes when loading data with Just

I have an app that sometimes crashes. Not always, but every now and then it crashes. I think it has something to do with Just. I use this pod to do some network stuff. When I set an exception breakpoint, it jumps out at a function in the Just pod:
func makeTask(_ request: URLRequest, configuration: TaskConfiguration)
-> URLSessionDataTask? {
let task = session.dataTask(with: request)
taskConfigs[task.taskIdentifier] = configuration
return task
}
The console shows the error message: "[_NSCoreDataTaggedObjectID count]: unrecognized selector sent to instance 0x8000000000000000".
In the Crashlog it says:
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x8000000000000008
VM Region Info: 0x8000000000000008 is not in any region. Bytes after previous region: 9223372025580486665
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
MALLOC_NANO 0000000280000000-00000002a0000000 [512.0M] rw-/rwx SM=PRV
--->
UNUSED SPACE AT END
Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [28922]
Triggered by Thread: 4
Thread 4 looks like this:
Thread 4 name: Dispatch queue: NSOperationQueue 0x283042520 (QOS: UNSPECIFIED)
Thread 4 Crashed:
0 libswiftCore.dylib
1 Just
2 Just
3 Just
4 Just
5 Just
6 Just
7 [app name]
8 [app name]
9 [app name]
10 Foundation
11 Foundation
12 Foundation
13 Foundation
14 libdispatch.dylib
15 libdispatch.dylib
16 libdispatch.dylib
17 libdispatch.dylib
18 libdispatch.dylib
19 libdispatch.dylib
20 libsystem_pthread.dylib
21 libsystem_pthread.dylib
I have no clue why this happens. So I would appreciate some help from you guys.
Edit: This happens when I start the app on a newer iPhone, e.g iPhone 8 or iPhone X. When I run it on a 5s it doesn't crash. All devices have at least iOS 12.
Okay, I got it, if anyone is interested. The problem was that the new phones are too fast, and the app tried to read values that didn't exist already. So I added a small delay, and everything worked fine.

iPhone App recently uploaded to App Store crashes on launch

I uploaded the new version of my iPhone App into the App Store. And it got released last day. The problem is App is crashing on the very launch. I got the crash log as follows. Any help will be really appreciable.
Here is my crash log,
Incident Identifier: 7868F4D2-C13E-4D97-995F-A69F85022F8C
CrashReporter Key: 113c3b5b073754be0c5c2b9758ca6b6d2afa09e6
Hardware Model: iPhone3,1
Process: Ph_PDF [623]
Path: /var/mobile/Applications/85E5F394-9006-431D-8F40-4780112F0343/Ph_PDF.app/Ph_PDF
Identifier: Ph_PDF
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2012-11-05 11:13:04.916 +0530
OS Version: iPhone OS 5.0 (9A334)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x96f6c04c
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x37ff9fbc objc_msgSend + 16
1 Ph_PDF 0x000178ae 0x1000 + 92334
2 UIKit 0x32e2c7e4 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1180
3 UIKit 0x32e263b6 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 390
4 UIKit 0x32df491a -[UIApplication handleEvent:withNewEvent:] + 1010
5 UIKit 0x32df43b8 -[UIApplication sendEvent:] + 48
6 UIKit 0x32df3d26 _UIApplicationHandleEvent + 5802
7 GraphicsServices 0x339dfe0c PurpleEventCallback + 876
8 CoreFoundation 0x30e2e54c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 32
9 CoreFoundation 0x30e2e4ee __CFRunLoopDoSource1 + 134
10 CoreFoundation 0x30e2d33c __CFRunLoopRun + 1364
11 CoreFoundation 0x30db04d6 CFRunLoopRunSpecific + 294
12 CoreFoundation 0x30db039e CFRunLoopRunInMode + 98
13 UIKit 0x32e25450 -[UIApplication _run] + 544
14 UIKit 0x32e2273c UIApplicationMain + 1084
15 Ph_PDF 0x0000250c 0x1000 + 5388
16 Ph_PDF 0x000024c0 0x1000 + 5312
this is objc_msgSend, you are calling method on object that doesn't respond to respective selector...
maybe deprecated method that is no longer included in SDK or specified iOS version, maybe you forgot to link against specific library for release version?
Have you tested your app against all iOS versions that your app claims to support?
Would you be using Core Data by any chance and modified your Core Data entity structure?
If you can provide some insight on what sort of technology your app uses and also what you changed since last working version on the app store, that would help.
The png crush may cause the app to crash in some situations. Thats because when the app is not able to get the image correctly for displaying, it will crash. I think in your case, the app is crashing on the startup. Please check your splash screen image first.
At last i found out the problem. As i was migrated to the new XCode i updated the Google Analytics Library to the new version which needs to support the armv7s architecture. It works fine in the new XCode. But i uploaded the binary from the old Mac which have XCode 3.2.5. When i am building it gives no error. But when the app is working in the device it crashes. I reverted the google analytics library to the older version and the problem got solved.
Thanks for your support guys..:)

Xcode 4.2 crashes in archive when "validate" or "submit" are pressed

i put together a program. It works and was tested.
for the last 24 hours i was googling/trying to get it up to be validated.
Someone please do a walkthrough the settings so i can set the right checkmarks and submit it.
I have xcode 4.2, iOS lion.
ERROR MESSAGE
Xcode encountered an internal logic error. Choose "Continue" to continue running Xcode in an inconsistent state. Choose "Crash" to halt Xcode and file a bug with Crash Reporter. Choosing "Crash" will result in the loss of all unsaved data.
ERROR DETAILS
UNCAUGHT EXCEPTION (NSInvalidArgumentException): -[ITunesSoftwareApplicationDescription applicationType]: unrecognized selector sent to instance 0x402818c00
UserInfo: (null)
Hints: None
Backtrace:
0 0x00007fff9134426a __exceptionPreprocess (in CoreFoundation)
1 0x00007fff89b73d5e objc_exception_throw (in libobjc.A.dylib)
2 0x00007fff913d04ce -[NSObject doesNotRecognizeSelector:] (in CoreFoundation)
3 0x00007fff91331133 __forwarding__ (in CoreFoundation)
4 0x00007fff91330f48 _CF_forwarding_prep_0 (in CoreFoundation)
5 0x000000011114ec9b __block_global_8 (in IDEArchivedApplicationsViewer)
6 0x00007fff9136ded2 __NSArrayChunkIterate (in CoreFoundation)
7 0x00007fff913c9491 ____NSArrayGetIndexesPassingTest_block_invoke_1 (in CoreFoundation)
8 0x00007fff92054467 _dispatch_apply_serial (in libdispatch.dylib)
9 0x00007fff920529d7 _dispatch_sync_f_invoke (in libdispatch.dylib)
10 0x00007fff92054347 dispatch_apply_f (in libdispatch.dylib)
11 0x00007fff92054697 _dispatch_apply_slow (in libdispatch.dylib)
12 0x00007fff9133f2d2 __NSArrayGetIndexesPassingTest (in CoreFoundation)
13 0x000000011114eaee __50-[AAVFetchApplicationListAssistant viewDidInstall]_block_invoke_0 (in IDEArchivedApplicationsViewer)
14 0x00007fff920508ba _dispatch_call_block_and_release (in libdispatch.dylib)
15 0x00007fff92051799 _dispatch_worker_thread2 (in libdispatch.dylib)
16 0x00007fff892183da _pthread_wqthread (in libsystem_c.dylib)
17 0x00007fff89219b85 start_wqthread (in libsystem_c.dylib)
It looks like it's your XCode, not your built app that is causing the crash.
My best advise would be checking for XCode upgrades, or maybe do a clean install. It's quickly pulled from the OSX AppStore.
To uninstall Xcode you can run the following command :
sudo /Developer/Library/uninstall-devtools –mode=all

App crashes on ZKFileArchive

I've build my app to download a few zip-files with sizes from 10 up to 25 MB.
After download to the local documents folder I fire the ZKFileArchive method to unzip to that same folder.
In debug modus (device/simulator) all works fine. When I create a release which I install, the app crashes when it reaches
ZKFileArchive *archive = [ZKFileArchive archiveWithArchivePath:filePath];
With NSZombie enabled it throws me this:
Thread 10 Crashed:
0 Hoppr iOS 0x0003318c +[ZKFileArchive archiveWithArchivePath:] (ZKFileArchive.m:185)
1 Hoppr iOS 0x00004092 -[LaunchDownload inflateFile:withDict:] (LaunchDownload.m:348)
2 Foundation 0x33fbeb8a 0x33fb3000 + 48010
3 Foundation 0x33fb7b90 0x33fb3000 + 19344
4 libSystem.B.dylib 0x32d27b44 0x32c9c000 + 572228
5 libSystem.B.dylib 0x32d197a4 0x32c9c000 + 513956
Could this be a memory issue? From times to times it throws me a level 1 memory warning, but as I've been reading this should not cause too much problems.
Any ideas?
Thanks in advance!
[EDIT]
The top of this logfile:
Incident Identifier: 1BEC1CCB-AD95-4A06-8F4F-3DA1A2A4F18D
CrashReporter Key: 36fcd8536ee68a7e6b261ba23f2ec090b98d388e
Hardware Model: iPod2,1
Process: Hoppr iOS [1340]
Path: /var/mobile/Applications/47587D8A-AE7E-4C26-9C23-9394DE268E69/Hoppr iOS.app/Hoppr iOS
Identifier: Hoppr iOS
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2011-03-16 15:49:22.041 +0100
OS Version: iPhone OS 4.2.1 (8C148)
Report Version: 104
Exception Type: EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes: 0x00000001, 0xe92d0d00
Crashed Thread: 10
The framework you are linking looks like it was not built for the target platform. Illegal instruction means there is something very wrong with the binary.