xcode: Empty project with WKPicker causes libc++abi.dylib NSException - ios

2015-08-17 06:18:50.281 testcrash WatchKit Extension[1050:29694] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<InterfaceController 0x7d248f80> valueForUndefinedKey:]: this class is not key value coding-compliant for the key (null).'
*** First throw call stack:
(
0 CoreFoundation 0x02f882c4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x00682df4 objc_exception_throw + 50
2 CoreFoundation 0x02f87ee1 -[NSException raise] + 17
3 Foundation 0x002c4696 -[NSObject(NSKeyValueCoding) valueForUndefinedKey:] + 282
4 Foundation 0x00205870 _NSGetUsingKeyValueGetter + 105
5 Foundation 0x002057ff -[NSObject(NSKeyValueCoding) valueForKey:] + 288
6 WatchKit 0x0014d454 __48-[SPRemoteInterface handlePlist:fromIdentifier:]_block_invoke905 + 46
7 libdispatch.dylib 0x03db8837 _dispatch_call_block_and_release + 15
8 libdispatch.dylib 0x03dd641d _dispatch_client_callout + 14
9 libdispatch.dylib 0x03dbf0da _dispatch_main_queue_callback_4CF + 689
10 CoreFoundation 0x02eda46e __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 14
11 CoreFoundation 0x02e981e4 __CFRunLoopRun + 2356
12 CoreFoundation 0x02e975f6 CFRunLoopRunSpecific + 470
13 CoreFoundation 0x02e9740b CFRunLoopRunInMode + 123
14 Foundation 0x00241e11 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 308
15 Foundation 0x002e7f6d -[NSRunLoop(NSRunLoop) run] + 82
16 libxpc.dylib 0x040d30c7 _xpc_objc_main + 486
17 libxpc.dylib 0x040d5e26 xpc_main + 215
18 Foundation 0x00410fb5 service_connection_handler + 0
19 PlugInKit 0x02e001f4 -[PKService run] + 582
20 WatchKit 0x00171509 main + 146
21 libdyld.dylib 0x03dfbae1 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
I get this crash with a clean, new project. Drag an WKPicker into the storyboard and try to simulate the program.
(native watchos2 app)

The problem here seems to be the picker stays empty.
var foodList: [(String, String)] = [
("Broccoli", "Gross"),
("Brussel Sprouts", "Gross"),
("Soup", "Delicious"),
("Steak", "Delicious"),
("Ramen", "Delicious"),
("Pizza", "Delicious") ]
override func willActivate() {
// This method is called when watch view controller is about to be visible to user
super.willActivate()
let pickerItems: [WKPickerItem] = foodList.map {
let pickerItem = WKPickerItem()
pickerItem.title = $0.0
pickerItem.caption = $0.1
return pickerItem
}
serverPicker.setItems(pickerItems)
}
Resolves that problem.
Copied from: http://www.sneakycrab.com/blog/2015/6/12/wkinterfacepicker-in-watchkit-20-using-the-digital-crown

Related

Core Data - Crash while listening for notification NSManagedObjectContextDidSave

Seeing a strange crash while listening
NotificationCenter.default.addObserver(self, selector: #selector(contextDidSave(_:)), name: .NSManagedObjectContextDidSave, object: nil)
#objc private func contextDidSave(_ notification: Notification) {
print(notification)
}
However, keeping below line and calling something else inside it not causing any issues.
Below code will work fine as we are not printing or consuming objects
if let updatedObjects = notification.userInfo?[NSUpdatedObjectsKey] as? Set<User>, !updatedObjects.isEmpty {
myMethod()
}
Already debugged by using NSZombiesEnabled, InstrumentsWithCoreData, Exception Breakpoints,ThreadSanatizer, "Arguments Passed on Launch" in -com.apple.CoreData.ConcurrencyDebug 1
Unable to get why it's happening. However i thought it's of property so I printed all property 1 by 1 it worked fine for me.
As per as my knowledge it's happening because of combination of Swift and Obj-C
It's a huge project so I am not sure what can be done?
Is there a way that I can get more info about object via it's reference mat be object name or another information, Somehow?
** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFBoolean objectID]: unrecognized selector sent to instance 0x7fff80634470'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff23e3de6e __exceptionPreprocess + 350
1 libobjc.A.dylib 0x00007fff512539b2 objc_exception_throw + 48
2 CoreFoundation 0x00007fff23e5eb94 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x00007fff23e4286c ___forwarding___ + 1436
4 CoreFoundation 0x00007fff23e44b58 _CF_forwarding_prep_0 + 120
5 CoreData 0x00007fff23a816c9 -[NSManagedObject _descriptionValues] + 1566
6 CoreData 0x00007fff23a819f1 -[NSManagedObject description] + 261
7 CoreFoundation 0x00007fff23e60600 -[NSSet descriptionWithLocale:indent:] + 416
8 CoreFoundation 0x00007fff23e37858 -[NSDictionary descriptionWithLocale:indent:] + 1416
9 Foundation 0x00007fff259698c9 _NSDescriptionWithLocaleFunc + 55
10 CoreFoundation 0x00007fff23dc7281 __CFStringAppendFormatCore + 12737
11 CoreFoundation 0x00007fff23dc8ea5 _CFStringCreateWithFormatAndArgumentsAux2 + 133
12 CoreData 0x00007fff23a324a4 _NSCoreDataLog + 248
13 CoreData 0x00007fff239f7e80 -[NSManagedObjectContext(_NSInternalAdditions) _didSaveChanges] + 2893
14 CoreData 0x00007fff239ee7d6 -[NSManagedObjectContext save:] + 4166
15 *********** 0x00000001076e8db3 __31-[MyStorageManager saveContext]_block_invoke + 83
16 CoreData 0x00007fff23a0338d developerSubmittedBlockToNSManagedObjectContextPerform + 154
17 libdispatch.dylib 0x000000010f252e8e _dispatch_client_callout + 8
18 libdispatch.dylib 0x000000010f260d97 _dispatch_main_queue_callback_4CF + 1149
19 CoreFoundation 0x00007fff23da1869 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
20 CoreFoundation 0x00007fff23d9c3b9 __CFRunLoopRun + 2041
21 CoreFoundation 0x00007fff23d9b8a4 CFRunLoopRunSpecific + 404
22 GraphicsServices 0x00007fff38c39bbe GSEventRunModal + 139
23 UIKitCore 0x00007fff49325968 UIApplicationMain + 1605
24 *********** 0x00000001074dc882 main + 146
25 libdyld.dylib 0x00007fff520ce1fd start + 1
26 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

How do i resolve this error while running react-native project in Xcode?

Here is the log in Xcode
2017-09-05 11:12:06.477 AppDemo[5064:29077] -[NSTaggedPointerString unsignedIntValue]: unrecognized selector sent to instance 0xa303036383231327
2017-09-05 11:12:06.642 AppDemo[5064:29077] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSTaggedPointerString unsignedIntValue]: unrecognized selector sent to instance 0xa303036383231327'
*** First throw call stack:
(
0 CoreFoundation 0x0000000110564b0b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010f41a141 objc_exception_throw + 48
2 CoreFoundation 0x00000001105d4134 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x00000001104eb840 ___forwarding___ + 1024
4 CoreFoundation 0x00000001104eb3b8 _CF_forwarding_prep_0 + 120
5 AppDemo 0x000000010e7cfc94 -[RCTMultipartStreamReader emitProgress:contentLength:final:callback:] + 244
6 AppDemo 0x000000010e7d048a -[RCTMultipartStreamReader readAllPartsWithCompletionCallback:progressCallback:] + 1610
7 AppDemo 0x000000010e81fdbc -[RCTMultipartDataTask URLSession:streamTask:didBecomeInputStream:outputStream:] + 444
8 CFNetwork 0x000000010ffc4c51 __88-[NSURLSession delegate_streamTask:didBecomeInputStream:outputStream:completionHandler:]_block_invoke + 51
9 Foundation 0x000000010ef243b7 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 7
10 Foundation 0x000000010ef240bb -[NSBlockOperation main] + 101
11 Foundation 0x000000010ef22877 -[__NSOperationInternal _start:] + 627
12 Foundation 0x000000010ef1e5fc __NSOQSchedule_f + 198
13 libdispatch.dylib 0x000000011424605c _dispatch_client_callout + 8
14 libdispatch.dylib 0x000000011422494f _dispatch_queue_serial_drain + 221
15 libdispatch.dylib 0x0000000114225669 _dispatch_queue_invoke + 1084
16 libdispatch.dylib 0x0000000114227ec4 _dispatch_root_queue_drain + 634
17 libdispatch.dylib 0x0000000114227bef _dispatch_worker_thread3 + 123
18 libsystem_pthread.dylib 0x00000001145dd712 _pthread_wqthread + 1299
19 libsystem_pthread.dylib 0x00000001145dd1ed start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException

Layer ATLConversationListViewController Crash

I am getting the following crash. I am using Layer messaging sdk and on it Atlas messenger sample. This issue is coming sometime when i am navigating from conversationListView to conversationView. Is there any solution to it.
(
0 CoreFoundation 0x000000010ba10b0b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010b47c141 objc_exception_throw + 48
2 CoreFoundation 0x000000010ba14cf2 +[NSException raise:format:arguments:] + 98
3 Foundation 0x000000010b0163b6 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 193
4 UIKit 0x000000010a03053d -[UICollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:animator:] + 15364
5 UIKit 0x000000010a039259 -[UICollectionView _endUpdatesWithInvalidationContext:tentativelyForReordering:animator:] + 71
6 UIKit 0x000000010a0395a0 -[UICollectionView _performBatchUpdates:completion:invalidationContext:tentativelyForReordering:animator:] + 437
7 UIKit 0x000000010a0393c8 -[UICollectionView _performBatchUpdates:completion:invalidationContext:tentativelyForReordering:] + 91
8 UIKit 0x000000010a03934a -[UICollectionView _performBatchUpdates:completion:invalidationContext:] + 74
9 UIKit 0x000000010a03929f -[UICollectionView performBatchUpdates:completion:] + 53
10 Atlas 0x0000000104ed30ce -[ATLConversationViewController queryControllerDidChangeContent:] + 1134
11 LayerKit 0x0000000106bb2b0a __76-[LYRQueryController updateWithObjectIdentifiers:changedObjectsIdentifiers:]_block_invoke.239 + 74
12 libdispatch.dylib 0x000000010cde905c _dispatch_client_callout + 8
13 libdispatch.dylib 0x000000010cdcc0f8 _dispatch_barrier_sync_f_slow_invoke + 579
14 libdispatch.dylib 0x000000010cde905c _dispatch_client_callout + 8
15 libdispatch.dylib 0x000000010cdca40b _dispatch_main_queue_callback_4CF + 411
16 CoreFoundation 0x000000010b9d5909 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
17 CoreFoundation 0x000000010b99bae4 __CFRunLoopRun + 2164
18 CoreFoundation 0x000000010b99b016 CFRunLoopRunSpecific + 406
19 GraphicsServices 0x000000010de41a24 GSEventRunModal + 62
20 UIKit 0x00000001096e50d4 UIApplicationMain + 159
21 SampleApp 0x000000010439f797 main + 55
22 libdyld.dylib 0x00000001095c865d start + 1
)
Error Description:
[ATLConversationCollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:animator:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit/UIKit-3600.7.47/UICollectionView.m:5765
2017-06-23 11:33:27.473137+0530 SampleApp[1815:546610] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of sections. The number of sections contained in the collection view after the update (3) must be equal to the number of sections contained in the collection view before the update (3), plus or minus the number of sections inserted or deleted (1 inserted, 0 deleted).'
*** First throw call stack:
(0x19207afd8 0x190adc538 0x19207aeac 0x192b12710 0x198ab47cc 0x198ab865c 0x198ab893c 0x198ab879c 0x198ab8720 0x198380558 0x10099f14c 0x101eb12b4 0x105039a10 0x10504a5e4 0x105039a10 0x10503eb78 0x1920290c0 0x192026cdc 0x191f56d94 0x1939c0074 0x19820f130 0x10010b454 0x190f6559c)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

Error with Braintree UI BTDropInViewController

this is my first time implementing Braintree and I've been following the documentation clearly. I've integrated it with CocoaPods but I have an issue in BTDropInViewController. It throws an error
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[UIColor bt_colorWithBytesR:G:B:]: unrecognized selector sent to class 0x10fd17948
In this line
BTDropInViewController *dropInViewController = [[BTDropInViewController alloc]
initWithAPIClient:self.braintreeClient];
I've tried to import these 3 headers just to be sure, but still the same result
#import <Braintree/UIColor+BTUI.h>
#import "BraintreeUI.h"
#import <Braintree/BTUI.h>
And here is the full error
2016-11-16 15:56:35.418 Projc[43766:2236752] +[UIColor bt_colorWithBytesR:G:B:]: unrecognized selector sent to class 0x10fd17948
2016-11-16 15:56:35.504 Projc[43766:2236752] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[UIColor bt_colorWithBytesR:G:B:]: unrecognized selector sent to class 0x10fd17948'
*** First throw call stack:
(
0 CoreFoundation 0x00000001116aaf45 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000110998deb objc_exception_throw + 48
2 CoreFoundation 0x00000001116b346d +[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x0000000111600eea ___forwarding___ + 970
4 CoreFoundation 0x0000000111600a98 _CF_forwarding_prep_0 + 120
5 Projc 0x000000010ccb95b0 -[BTUI borderColor] + 64
6 Projc 0x000000010cc9abf4 -[BTDropInContentView initWithFrame:] + 964
7 UIKit 0x000000010f0abe3d -[UIView init] + 62
8 Projc 0x000000010ccc329e -[BTUIThemedView init] + 62
9 Projc 0x000000010cca5fed -[BTDropInViewController initWithAPIClient:] + 285
10 Projc 0x000000010cb0998b __51-[RegisterController basicPlanClicked]_block_invoke + 411
11 Projc 0x000000010cac1a66 __59-[downloadJson:endPointString:WithHandler:]_block_invoke + 214
12 CFNetwork 0x000000010d4f5b3d __75-[__NSURLSessionLocal taskForClass:request:uploadFile:bodyData:completion:]_block_invoke + 19
13 CFNetwork 0x000000010d507fb6 __49-[__NSCFLocalSessionTask _task_onqueue_didFinish]_block_invoke + 302
14 Foundation 0x000000011060c3b8 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 7
15 Foundation 0x00000001105480e5 -[NSBlockOperation main] + 101
16 Foundation 0x000000011052b036 -[__NSOperationInternal _start:] + 646
17 Foundation 0x000000011052ac47 __NSOQSchedule_f + 194
18 libdispatch.dylib 0x0000000111e0649b _dispatch_client_callout + 8
19 libdispatch.dylib 0x0000000111dee2af _dispatch_main_queue_callback_4CF + 1738
20 CoreFoundation 0x000000011160b2e9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
21 CoreFoundation 0x00000001115cc8a9 __CFRunLoopRun + 2073
22 CoreFoundation 0x00000001115cbe08 CFRunLoopRunSpecific + 488
23 GraphicsServices 0x0000000112291ad2 GSEventRunModal + 161
24 UIKit 0x000000010f01f30d UIApplicationMain + 171
25 Projc 0x000000010cba86bf main + 111
26 libdyld.dylib 0x0000000111e3b92d start + 1
27 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

Restkit / CoreData __NSCFBoolean length unrecognized selector sent to instance

I am trying to debug this crash. It seems to be inside Apple's framework in description method but I don't know what it's causing it.
I'm using Restkit and Core Data. I get the crash as soon as the API returns a new model "Category" with array "products" empty.
Thank you
RRCategory + RRProduct models
https://gist.github.com/imton/6f7ff91bc3f3ac25a490
Mappings
https://gist.github.com/imton/33236e0ddefef0d50a35
https://gist.github.com/imton/9baa6a35a4a8f71aa440
Api Json https://gist.github.com/imton/118736e59c1a1092dc1b
{
"categories": [
{
"token": "6G1RKVMcfNdcbAX",
"title": "Cat3",
"picture_token": "ASDFASDF",
"products": []
}
]
}
Backstack
2014-12-07 10:55:30.838 Riderr[91164:34420246] -[__NSCFBoolean length]: unrecognized selector sent to instance 0x10375c970
2014-12-07 10:55:30.862 Riderr[91164:34420246] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFBoolean length]: unrecognized selector sent to instance 0x10375c970'
*** First throw call stack:
(
0 CoreFoundation 0x00000001034b1b75 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010314abb7 objc_exception_throw + 45
2 CoreFoundation 0x00000001034b8c8d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x00000001034106fc ___forwarding___ + 988
4 CoreFoundation 0x0000000103410298 _CF_forwarding_prep_0 + 120
5 CoreData 0x0000000100d3135c -[NSManagedObject _descriptionValues] + 620
6 CoreData 0x0000000100d3195b -[NSManagedObject description] + 267
7 Riderr 0x000000010037393b -[NSManagedObject(FixCrashBug) description_swizzle] + 43
8 CoreFoundation 0x00000001034a3ea6 -[NSArray descriptionWithLocale:indent:] + 358
9 Foundation 0x00000001014f3524 _NSDescriptionWithLocaleFunc + 64
10 CoreFoundation 0x00000001033ac97d __CFStringAppendFormatCore + 9645
11 CoreFoundation 0x00000001034922f0 _CFStringCreateWithFormatAndArgumentsAux2 + 256
12 Foundation 0x00000001014f34b8 -[NSPlaceholderString initWithFormat:locale:arguments:] + 153
13 Riderr 0x00000001003ad29c +[DDLog log:level:flag:context:file:function:line:tag:format:] + 588
14 Riderr 0x0000000100373b6d __21-[RRHomeTableVC sync]_block_invoke + 205
15 Riderr 0x00000001003770be __72-[RRRiderrClient getAllCategoriesWithProductsSuccessBlock:failureBlock:]_block_invoke + 142
16 Riderr 0x000000010051b92b __66-[RKObjectRequestOperation setCompletionBlockWithSuccess:failure:]_block_invoke244 + 91
17 libdispatch.dylib 0x00000001041b4b06 _dispatch_call_block_and_release + 12
18 libdispatch.dylib 0x00000001041d2794 _dispatch_client_callout + 8
19 libdispatch.dylib 0x00000001041bb89b _dispatch_main_queue_callback_4CF + 949
20 CoreFoundation 0x0000000103419469 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
21 CoreFoundation 0x00000001033dc36b __CFRunLoopRun + 2043
22 CoreFoundation 0x00000001033db906 CFRunLoopRunSpecific + 470
23 GraphicsServices 0x00000001076de9f0 GSEventRunModal + 161
24 UIKit 0x0000000101e901a0 UIApplicationMain + 1282
25 Riderr 0x0000000100370fbc main + 140
26 libdyld.dylib 0x0000000104207145 start + 1
27 ??? 0x0000000000000001 0x0 + 1
)
It means that you give an NSNumber-wrapped Boolean to CoreData when it expects a string.
Then apparently you use method swizzling which is a pretty bad idea and may lead to such crashes.

Resources