Reputation: 307
I am developing an iOS app (written in Swift) since weeks. Everything worked fine since a couple of hours ago. Now, at startup, I'm getting an error that occurs between the time the App Delegate application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool
returns and the VC's viewDidLoad()
launches
The debugger warns me -[UIView _setLayerConfig:]: unrecognized selector sent to instance
[NSException]
I've already tried to review all my properties, methods and especially the last couple of view I added before the error first appeared.
Here are the various pieces of code that (I hope) could contain the explanation :
1. App Delegate
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
print("Starting App Launch (App Delegate)")
return true
}
func applicationWillResignActive(application: UIApplication) {...}
func applicationDidEnterBackground(application: UIApplication) {...}
func applicationWillEnterForeground(application: UIApplication) {...}
func applicationDidBecomeActive(application: UIApplication) {...}
func applicationWillTerminate(application: UIApplication) {...}
}
2. ViewController's viewDidLoad()
override func viewDidLoad() {
super.viewDidLoad()
print("Starting App Launch (View Controller)") //Does not prints, might mean class is not even initialized
refreshView.layer.cornerRadius = 22
noteScrollView.delegate = self
let fingerDragGesture = UIPanGestureRecognizer(target: self, action: Selector("dragingFinger:"))
fingerDragGesture.minimumNumberOfTouches = 2
self.noteScrollView.addGestureRecognizer(fingerDragGesture)
registerForKeyboardNotifications()
}
3. Console output
'Starting App Launch (App Delegate)'
2015-10-21 21:20:34.880 InkBook[751:98309] -[UIView _setLayerConfig:]: unrecognized selector sent to instance 0x1476873d0
4. Crash Log (Symbolicated from a crash that occurred after the previous one)
Incident Identifier: A4B7E0B2-AC34-4D14-9492-A934ACA6B31F
CrashReporter Key: 08344d4a2247bd71ab8e45b3ad9a8a80390be4dc
Hardware Model: iPhone7,1
Process: InkBook [751]
Path: /private/var/mobile/Containers/Bundle/Application/12A79FA4-8B45-4F3B-A489-9451461E3655/InkBook.app/InkBook
Identifier: xyz.digital-labs.InkBook
Version: 1 (1.0)
Code Type: ARM-64 (Native)
Parent Process: launchd [1]
Date/Time: 2015-10-21 21:36:51.51 +0200
Launch Time: 2015-10-21 21:20:30.30 +0200
OS Version: iOS 9.1 (13B137)
Report Version: 105
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x00000000e7ffdefe
Triggered by Thread: 0
Filtered syslog:
None found
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x000000019986bf48 objc_exception_throw + 0
1 CoreFoundation 0x0000000184cbfc5c __methodDescriptionForSelector + 0
2 CoreFoundation 0x0000000184cbcc00 ___forwarding___ + 872
3 CoreFoundation 0x0000000184bc0cac _CF_forwarding_prep_0 + 92
4 UIKit 0x000000018a7c05cc -[UIVisualEffectView _configureForEffectConfig:] + 960
5 UIKit 0x000000018a7bfadc -[UIVisualEffectView _configureForCurrentEffect] + 116
6 UIKit 0x000000018a7bf640 -[UIVisualEffectView initWithCoder:] + 356
7 UIKit 0x000000018a82ffdc UINibDecoderDecodeObjectForValue + 672
8 UIKit 0x000000018a82fd24 -[UINibDecoder decodeObjectForKey:] + 336
9 UIKit 0x000000018a711c38 -[UIRuntimeConnection initWithCoder:] + 188
10 UIKit 0x000000018a82ffdc UINibDecoderDecodeObjectForValue + 672
11 UIKit 0x000000018a830154 UINibDecoderDecodeObjectForValue + 1048
12 UIKit 0x000000018a82fd24 -[UINibDecoder decodeObjectForKey:] + 336
13 UIKit 0x000000018a710f6c -[UINib instantiateWithOwner:options:] + 1220
14 UIKit 0x000000018a5bc14c -[UIViewController _loadViewFromNibNamed:bundle:] + 376
15 UIKit 0x000000018a38849c -[UIViewController loadView] + 176
16 UIKit 0x000000018a24bd44 -[UIViewController loadViewIfRequired] + 144
17 UIKit 0x000000018a24bc9c -[UIViewController view] + 28
18 UIKit 0x000000018a252a38 -[UIWindow addRootViewControllerViewIfPossible] + 76
19 UIKit 0x000000018a24ff78 -[UIWindow _setHidden:forced:] + 252
20 UIKit 0x000000018a2c58f0 -[UIWindow makeKeyAndVisible] + 48
21 UIKit 0x000000018a4efcf4 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 3456
22 UIKit 0x000000018a4f3e0c -[UIApplication _runWithMainScene:transitionContext:completion:] + 1656
23 UIKit 0x000000018a4f0f50 -[UIApplication workspaceDidEndTransaction:] + 168
24 FrontBoardServices 0x000000018ead77c4 -[FBSSerialQueue _performNext] + 184
25 FrontBoardServices 0x000000018ead7b44 -[FBSSerialQueue _performNextFromRunLoopSource] + 56
26 CoreFoundation 0x0000000184c70544 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
27 CoreFoundation 0x0000000184c6ffd8 __CFRunLoopDoSources0 + 540
28 CoreFoundation 0x0000000184c6dcd8 __CFRunLoopRun + 724
29 CoreFoundation 0x0000000184b9cca0 CFRunLoopRunSpecific + 384
30 UIKit 0x000000018a2ba1c8 -[UIApplication _run] + 460
31 UIKit 0x000000018a2b4ffc UIApplicationMain + 204
32 InkBook 0x0000000100098ea4 main (AppDelegate.swift:18)
33 libdyld.dylib 0x000000019a0ba8b8 start + 4
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x000000019a1d84fc kevent_qos + 8
1 libdispatch.dylib 0x000000010135e328 0x101348000 + 90920
2 libdispatch.dylib 0x000000010134bee4 0x101348000 + 16100
Thread 2:
0 libsystem_kernel.dylib 0x000000019a1d7b6c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x000000019a29d530 _pthread_wqthread + 1284
2 libsystem_pthread.dylib 0x000000019a29d020 start_wqthread + 4
Thread 3:
0 libsystem_kernel.dylib 0x000000019a1d7b6c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x000000019a29d530 _pthread_wqthread + 1284
2 libsystem_pthread.dylib 0x000000019a29d020 start_wqthread + 4
Thread 4:
0 libsystem_kernel.dylib 0x000000019a1bc974 _kernelrpc_mach_vm_deallocate_trap + 8
1 libsystem_kernel.dylib 0x000000019a1bcbbc mach_vm_deallocate + 32
2 libsystem_malloc.dylib 0x000000019a207fb4 deallocate_pages + 88
3 libobjc.A.dylib 0x0000000199886ef0 (anonymous namespace)::AutoreleasePoolPage::kill() + 72
4 libobjc.A.dylib 0x0000000199886fcc (anonymous namespace)::AutoreleasePoolPage::tls_dealloc(void*) + 184
5 libsystem_pthread.dylib 0x000000019a29e1e0 _pthread_tsd_cleanup + 584
6 libsystem_pthread.dylib 0x000000019a29dd58 _pthread_exit + 136
7 libsystem_pthread.dylib 0x000000019a29d53c pthread_mutex_lock + 0
8 libsystem_pthread.dylib 0x000000019a29d020 start_wqthread + 4
Thread 5:
0 libsystem_pthread.dylib 0x000000019a29d01c start_wqthread + 0
Thread 6 name: Dispatch queue: com.apple.UIKit.KeyboardManagement
Thread 6:
0 libsystem_platform.dylib 0x000000019a296648 OSAtomicCompareAndSwap64Barrier + 16
1 libsystem_pthread.dylib 0x000000019a29daf0 pthread_rwlock_unlock + 336
2 libobjc.A.dylib 0x0000000199877548 rwlock_tt<false>::unlockRead() + 20
3 libobjc.A.dylib 0x00000001998739f0 lookUpImpOrForward + 432
4 libobjc.A.dylib 0x000000019987ddb8 _objc_msgSend_uncached_impcache + 56
5 CoreFoundation 0x0000000184bbb81c -[NSMethodSignature isEqual:] + 76
6 Foundation 0x0000000185b214dc -[NSXPCDecoder decodeInvocation] + 344
7 Foundation 0x0000000185ce60b4 _decodeObject + 1332
8 Foundation 0x0000000185b2080c _decodeObjectAfterSettingWhitelistForKey + 136
9 Foundation 0x0000000185b2075c -[NSXPCDecoder decodeObjectOfClass:forKey:] + 176
10 Foundation 0x0000000185b87658 -[NSXPCConnection _decodeAndInvokeMessageWithData:] + 312
11 Foundation 0x0000000185b102d0 message_handler + 712
12 libxpc.dylib 0x000000019a2d13b0 _xpc_connection_call_event_handler + 68
13 libxpc.dylib 0x000000019a2cf158 _xpc_connection_mach_event + 2132
14 libdispatch.dylib 0x0000000101349d64 0x101348000 + 7524
15 libdispatch.dylib 0x000000010134e2d4 0x101348000 + 25300
16 libdispatch.dylib 0x000000010135699c 0x101348000 + 59804
17 libdispatch.dylib 0x000000010134d334 0x101348000 + 21300
18 libdispatch.dylib 0x000000010135699c 0x101348000 + 59804
19 libdispatch.dylib 0x000000010134d958 0x101348000 + 22872
20 libdispatch.dylib 0x0000000101358898 0x101348000 + 67736
21 libdispatch.dylib 0x0000000101358590 0x101348000 + 66960
22 libsystem_pthread.dylib 0x000000019a29d470 _pthread_wqthread + 1092
23 libsystem_pthread.dylib 0x000000019a29d020 start_wqthread + 4
Thread 7:
0 libsystem_pthread.dylib 0x000000019a29d01c start_wqthread + 0
Thread 0 crashed with ARM Thread State (64-bit):
x0: 0x000000014756cdf0 x1: 0x000000018ac1eaa9 x2: 0x000000014756cf28 x3: 0x000000014756cf20
x4: 0x0000000000000000 x5: 0x000000000000000f x6: 0x0000000000000000 x7: 0x0000000000000000
x8: 0x00000001032f0d00 x9: 0x00000001032f0d08 x10: 0x00000000003ed600 x11: 0x0000000000000000
x12: 0x0034d6000034d600 x13: 0x0000000000000000 x14: 0x00000000ffffffff x15: 0x00000000ffffffe6
x16: 0x000000019a29d64c x17: 0x000000019988694c x18: 0x0000000000000000 x19: 0x000000014756cf20
x20: 0x00000001476873d0 x21: 0x000000019c73e340 x22: 0x0000000000000000 x23: 0x00000001a0ba4400
x24: 0x0000000000000000 x25: 0x000000018ac522ec x26: 0x0000000000000468 x27: 0x6400e034591d4c15
x28: 0x000000019fecf000 fp: 0x000000016fdc8e50 lr: 0x0000000184cbfc5c
sp: 0x000000016fdc8e20 pc: 0x000000019986bf48 cpsr: 0x80000000
5. Assembler Output with NSException Breakpoints
(31) UIApplicationMain
UIKit`UIApplicationMain:
0x18a2b4f30 <+0>: stp x24, x23, [sp, #-64]!
0x18a2b4f34 <+4>: stp x22, x21, [sp, #16]
0x18a2b4f38 <+8>: stp x20, x19, [sp, #32]
0x18a2b4f3c <+12>: stp x29, x30, [sp, #48]
0x18a2b4f40 <+16>: add x29, sp, #48
0x18a2b4f44 <+20>: mov x20, x3
0x18a2b4f48 <+24>: mov x21, x1
0x18a2b4f4c <+28>: mov x22, x0
0x18a2b4f50 <+32>: mov x0, x2
0x18a2b4f54 <+36>: bl 0x191f6742c
0x18a2b4f58 <+40>: mov x19, x0
0x18a2b4f5c <+44>: mov x0, x20
0x18a2b4f60 <+48>: bl 0x191f6742c
0x18a2b4f64 <+52>: mov x20, x0
0x18a2b4f68 <+56>: adrp x23, 92408
0x18a2b4f6c <+60>: add x23, x23, #4064
0x18a2b4f70 <+64>: ldr w8, [x23]
0x18a2b4f74 <+68>: cbnz w8, 0x18a2b4fa0 ; <+112>
0x18a2b4f78 <+72>: adrp x8, 92408
0x18a2b4f7c <+76>: ldr x8, [x8, #296]
0x18a2b4f80 <+80>: cmn x8, #1
0x18a2b4f84 <+84>: b.eq 0x18a2b4fd4 ; <+164>
0x18a2b4f88 <+88>: adrp x0, 92408
0x18a2b4f8c <+92>: add x0, x0, #296
0x18a2b4f90 <+96>: adrp x1, 77361
0x18a2b4f94 <+100>: add x1, x1, #1456
0x18a2b4f98 <+104>: bl 0x18ac191ac ; symbol stub for: +[UIKeyboardAssistantBar sharedInstance]
0x18a2b4f9c <+108>: ldr w8, [x23]
0x18a2b4fa0 <+112>: lsr w8, w8, #8
0x18a2b4fa4 <+116>: cmp w8, #513
0x18a2b4fa8 <+120>: b.lo 0x18a2b4fd4 ; <+164>
0x18a2b4fac <+124>: bl 0x191f672b8
0x18a2b4fb0 <+128>: mov x23, x0
0x18a2b4fb4 <+132>: mov x0, x22
0x18a2b4fb8 <+136>: mov x1, x21
0x18a2b4fbc <+140>: mov x2, x19
0x18a2b4fc0 <+144>: mov x3, x20
0x18a2b4fc4 <+148>: bl 0x18a4f5110 ; _UIApplicationMainPreparations
0x18a2b4fc8 <+152>: mov x0, x23
0x18a2b4fcc <+156>: bl 0x18ac1815c ; symbol stub for: -[_UIActivityApplicationExtensionDiscovery .cxx_destruct]
0x18a2b4fd0 <+160>: b 0x18a2b4fe8 ; <+184>
0x18a2b4fd4 <+164>: mov x0, x22
0x18a2b4fd8 <+168>: mov x1, x21
0x18a2b4fdc <+172>: mov x2, x19
0x18a2b4fe0 <+176>: mov x3, x20
0x18a2b4fe4 <+180>: bl 0x18a4f5110 ; _UIApplicationMainPreparations
0x18a2b4fe8 <+184>: adrp x8, 92408
0x18a2b4fec <+188>: ldr x0, [x8, #4048]
0x18a2b4ff0 <+192>: adrp x8, 89050
0x18a2b4ff4 <+196>: ldr x1, [x8, #2688]
0x18a2b4ff8 <+200>: bl 0x191f67298
0x18a2b4ffc <+204>: mov x0, x20 // Thread 1 : breakpoint 1.1
0x18a2b5000 <+208>: bl 0x191f67428
0x18a2b5004 <+212>: mov x0, x19
0x18a2b5008 <+216>: bl 0x191f67428
0x18a2b500c <+220>: movz w0, #0
0x18a2b5010 <+224>: ldp x29, x30, [sp, #48]
0x18a2b5014 <+228>: ldp x20, x19, [sp, #32]
0x18a2b5018 <+232>: ldp x22, x21, [sp, #16]
0x18a2b501c <+236>: ldp x24, x23, [sp], #64
0x18a2b5020 <+240>: ret
(32) main
InkBook`main:
0x100098e1c <+0>: stp x29, x30, [sp, #-16]!
0x100098e20 <+4>: mov x29, sp
0x100098e24 <+8>: sub sp, sp, #32
0x100098e28 <+12>: adrp x8, 188
0x100098e2c <+16>: ldr x8, [x8, #1312]
0x100098e30 <+20>: adrp x9, 188
0x100098e34 <+24>: ldr x9, [x9, #1200]
0x100098e38 <+28>: str w0, [x9]
0x100098e3c <+32>: ldr x8, [x8]
0x100098e40 <+36>: cmn x8, #1
0x100098e44 <+40>: stur w0, [x29, #-4]
0x100098e48 <+44>: str x1, [sp, #16]
0x100098e4c <+48>: b.eq 0x100098e68 ; <+76> at AppDelegate.swift:18
0x100098e50 <+52>: adrp x8, 188
0x100098e54 <+56>: ldr x0, [x8, #1312]
0x100098e58 <+60>: adrp x8, 188
0x100098e5c <+64>: ldr x8, [x8, #1304]
0x100098e60 <+68>: mov x1, x8
0x100098e64 <+72>: bl 0x100121714 ; symbol stub for: swift_once
0x100098e68 <+76>: adrp x8, 188
0x100098e6c <+80>: ldr x8, [x8, #1192]
0x100098e70 <+84>: ldr x9, [sp, #16]
0x100098e74 <+88>: str x9, [x8]
0x100098e78 <+92>: bl 0x100098c68 ; type metadata accessor for InkBook.AppDelegate
0x100098e7c <+96>: bl 0x100120544 ; symbol stub for: NSStringFromClass
0x100098e80 <+100>: movz x8, #0
0x100098e84 <+104>: ldr x9, [sp, #16]
0x100098e88 <+108>: ldur w10, [x29, #-4]
0x100098e8c <+112>: str x0, [sp, #8]
0x100098e90 <+116>: mov x0, x10
0x100098e94 <+120>: mov x1, x9
0x100098e98 <+124>: mov x2, x8
0x100098e9c <+128>: ldr x3, [sp, #8]
0x100098ea0 <+132>: bl 0x100120f4c ; symbol stub for: UIApplicationMain
0x100098ea4 <+136>: movz w10, #0 //Thread 1: Breakpoint 1.1
0x100098ea8 <+140>: str w0, [sp, #4]
0x100098eac <+144>: mov x0, x10
0x100098eb0 <+148>: mov sp, x29
0x100098eb4 <+152>: ldp x29, x30, [sp], #16
0x100098eb8 <+156>: ret
I hope you 'll be able to understand all these stuffs, I gave up after 6 hours fighting with AddressSanitizer, LLDB, Instruments ... #needHelpSOSME
Thanks in advance !
Upvotes: 1
Views: 2708
Reputation: 2211
I've encountered the same issue after updating the constraints for the iPad version of my App. Since it crash at start, even if I comment the entire code or uninstalled all the Views in my screen.
Finally, instead of rebuilding everything, I added a new scene and try to copy paste elements by elements to figure out what was the UiView that cause me some trouble.
Dan ask if there was a UIVisualEffectView in the storyboard and it was the case for me. So I oriented my focus on it and realise that it was that !
I deleted it completely because just uninstalled it from the scene is not enough.
Everything is fine now, I needed to rebuild only the visual effect instead of the entire scene.
Upvotes: 0
Reputation: 39
I encountered the same problem. I was playing with the constraint for iPad and iPhone and after I delete some constraints they became transparently but not fully deleted. So my fix was to delete them one more time. In this way, I fixed the problem.
Upvotes: 2
Reputation: 299
Had the same issue (in Obj-C), was missing the #import <UIKit/UIKit.h>
in the header
Upvotes: 0
Reputation: 307
I finally fixed this issue by rebuilding the scene from scratch in Interface Builder and reconnecting the outlets manually.
i didn't remove anything from the original hierarchy, so I don't really know what made my app crash, but at least it works now ...
Upvotes: 3