Flutter crash - Fatal Exception: NSInvalidArgumentException - flutter

I am getting crash in flutter firebase database , here is the crash log on crashlytics
Fatal Exception: NSInvalidArgumentException
*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[1]
Fatal Exception: NSInvalidArgumentException
0 CoreFoundation 0x19f11098c __exceptionPreprocess
1 libobjc.A.dylib 0x19ee390a4 objc_exception_throw
2 CoreFoundation 0x19f1663f8 -[__NSCFString characterAtIndex:].cold.1
3 CoreFoundation 0x19f16f75c -[__NSPlaceholderDictionary initWithObjects:forKeys:count:].cold.5
4 CoreFoundation 0x19effd5dc -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]
5 CoreFoundation 0x19efef470 +[NSDictionary dictionaryWithObjects:forKeys:count:]
6 Runner 0x104e69a44 __53-[FLTFirebaseDatabasePlugin handleMethodCall:result:]_block_invoke.437 + 292 (FLTFirebaseDatabasePlugin.m:292)
7 Runner 0x104d469bc __39-[FRepo abortTransactionsAtNode:error:]_block_invoke + 1426 (FRepo.m:1426)
8 libdispatch.dylib 0x19eddd610 _dispatch_call_block_and_release
9 libdispatch.dylib 0x19edde184 _dispatch_client_callout
10 libdispatch.dylib 0x19ed901d0 _dispatch_main_queue_callback_4CF$VARIANT$mp
11 CoreFoundation 0x19f08e3c4 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
12 CoreFoundation 0x19f0893b8 __CFRunLoopRun
13 CoreFoundation 0x19f0888bc CFRunLoopRunSpecific
14 GraphicsServices 0x1a8ef4328 GSEventRunModal
15 UIKitCore 0x1a311e6d4 UIApplicationMain
16 Runner 0x104cb0e58 main + 8 (AppDelegate.swift:8)
17 libdyld.dylib
0x19ef13460 start
Crashed: com.twitter.crashlytics.ios.exception
SIGABRT ABORT 0x000000019ef08ebc
Crashed: com.twitter.crashlytics.ios.exception
0 Runner 0x104cca6bc CLSProcessRecordAllThreads + 4329924284
1 Runner 0x104ccaaa4 CLSProcessRecordAllThreads + 4329925284
2 Runner 0x104cba310 CLSHandler + 4329857808
3 Runner 0x104cc8cb4 __CLSExceptionRecord_block_invoke + 4329917620
4 libdispatch.dylib 0x19edde184 _dispatch_client_callout + 16
5 libdispatch.dylib 0x19ed90c44 _dispatch_lane_barrier_sync_invoke_and_complete + 56
6 Runner 0x104cc8720 CLSExceptionRecord + 4329916192
7 Runner 0x104cc854c CLSExceptionRecordNSException + 4329915724
8 Runner 0x104cc8140 CLSTerminateHandler() + 4329914688
9 libc++abi.dylib 0x19eede304 std::__terminate(void (*)()) + 16
10 libc++abi.dylib 0x19eede29c std::terminate() + 44
11 libobjc.A.dylib 0x19ee392dc _objc_terminate() + 10
12 libdispatch.dylib 0x19edde198 _dispatch_client_callout + 36
13 libdispatch.dylib 0x19ed901d0 _dispatch_main_queue_callback_4CF$VARIANT$mp + 1044
14 CoreFoundation 0x19f08e3c4 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
15 CoreFoundation 0x19f0893b8 __CFRunLoopRun + 2004
16 CoreFoundation 0x19f0888bc CFRunLoopRunSpecific + 464
17 GraphicsServices 0x1a8ef4328 GSEventRunModal + 104
18 UIKitCore 0x1a311e6d4 UIApplicationMain + 1936
19 Runner 0x104cb0e58 main + 8 (AppDelegate.swift:8)
20 libdyld.dylib 0x19ef13460 start + 4

If the question is about why the exception
appears to be showing Crashlytics frames, it's known behavior and it's just an artifact of how Crashlytics attempts to write crash information during crash time. It doesn't indicate that Crashlytics itself is causing an issue. https://docs.fabric.io/apple/crashlytics/advanced-setup.html#crashlytics-frames-appearing-in-crashes

Related

[SPApplication _accessibilityInitialize]: unrecognized selector sent to instance on watchOS4

Once my watch app starts, it crashes with the following error:
2017-08-17 13:59:54.304792-0300 watchOS4 Extension[11500:1617313] -[SPApplication _accessibilityInitialize]: unrecognized selector sent to instance 0x79e5b8f0
2017-08-17 13:59:56.173675-0300 watchOS4 Extension[11500:1617313] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[SPApplication _accessibilityInitialize]: unrecognized selector sent to instance 0x79e5b8f0'
*** First throw call stack:
(
0 CoreFoundation 0x015ae80d __exceptionPreprocess + 189
1 libobjc.A.dylib 0x00f22bcf objc_exception_throw + 49
2 CoreFoundation 0x0162f978 -[NSObject(NSObject) doesNotRecognizeSelector:] + 136
3 CoreFoundation 0x015322c4 ___forwarding___ + 1300
4 CoreFoundation 0x01531d8e _CF_forwarding_prep_0 + 14
5 UIAccessibility 0x19a13e2c __54+[UIAccessibilityLoader _accessibilityLoadSubbundles:]_block_invoke.338 + 44
6 libdispatch.dylib 0x05f990bf _dispatch_call_block_and_release + 15
7 libdispatch.dylib 0x05f9a42c _dispatch_client_callout + 14
8 libdispatch.dylib 0x05fa4e88 _dispatch_main_queue_callback_4CF + 1204
9 CoreFoundation 0x0157116e __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 14
10 CoreFoundation 0x0153677e __CFRunLoopRun + 3310
11 CoreFoundation 0x015357e5 CFRunLoopRunSpecific + 373
12 CoreFoundation 0x0153565a CFRunLoopRunInMode + 122
13 GraphicsServices 0x08fde249 GSEventRunModal + 71
14 GraphicsServices 0x08fde12e GSEventRun + 80
15 UIKit 0x01a402d1 UIApplicationMain + 148
16 libxpc.dylib 0x06350a67 _xpc_objc_main + 528
17 libxpc.dylib 0x063533a0 xpc_main + 158
18 Foundation 0x009543c5 -[NSXPCListener resume] + 185
19 PlugInKit 0x057be28b -[PKService run] + 799
20 WatchKit 0x001cd123 main + 160
21 libdyld.dylib 0x05ffdd41 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
What does the SPApplication _accessibilityInitialize means? I do not implement any accessibility functionality yet.
Im running watchOS4 beta 6 and XCode 9 beta 5
For who else experiencing this problem: just restart Xcode and simulators and perform a Clean in the project. Worked for me.

Crash in ios 6 and later -[MKStoreManager provideContent:forReceipt:]

I have my app live which is non-consumable type.
App is crashing on iOS 6 and later. It is crashing on user's device but not on testing device.
Crash log says this:
Exception Type: SIGTRAP
Exception Codes: #0 at 0x3350316c
Crashed Thread: 0
Thread 0 Crashed:
0 CoreFoundation 0x3350316c _CFHash + 8
1 CoreFoundation 0x00002b50 CFBasicHashFindBucket + 1892
2 CoreFoundation 0x33503a8b _CFDictionaryGetValue + 83
3 CoreFoundation 0x0004a7a7 -[CFXPreferencesPropertyListSource setValue:forKey:] + 39
4 CoreFoundation 0x0004a723 _CFXPreferencesSetValue + 135
5 CoreFoundation 0x3354a601 _CFPreferencesSetAppValue + 41
6 Foundation 0x00009907 -[NSUserDefaults(NSUserDefaults) setObject:forKey:] + 83
7 myAppName 0x00038287 -[MKStoreManager provideContent:forReceipt:] (MKStoreManager.m:311)
8 myAppName 0x000387b1 -[MKStoreObserver restoreTransaction:] (MKStoreObserver.m:88)
9 myAppName 0x000385e1 -[MKStoreObserver paymentQueue:updatedTransactions:] (MKStoreObserver.m:64)
10 StoreKit 0x0000404d __NotifyObserverAboutChanges + 85
11 CoreFoundation 0x3350874d _CFArrayApplyFunction + 177
12 StoreKit 0x00003fe9 -[SKPaymentQueue _notifyObserversAboutChanges:sendUpdatedDownloads:] + 129
13 StoreKit 0x000048af -[SKPaymentQueue _processUpdates:trimUnmatched:sendUpdatedDownloads:] + 999
14 StoreKit 0x00004f8d -[SKPaymentQueue _setTransactionsWithReply:] + 157
15 StoreKit 0x00003b8b __block_global_0 + 63
16 libdispatch.dylib 0x0000211f _dispatch_call_block_and_release + 11
17 libdispatch.dylib 0x000014b7 _dispatch_client_callout + 23
18 libdispatch.dylib 0x000061bd _dispatch_main_queue_callback_4CF$VARIANT$mp + 225
19 CoreFoundation 0x00095f3b __CFRunLoopRun + 1291
20 CoreFoundation 0x33508ebd _CFRunLoopRunSpecific + 357
21 CoreFoundation 0x33508d49 _CFRunLoopRunInMode + 105
22 GraphicsServices 0x370bb2eb _GSEventRunModal + 75
23 UIKit 0x3541e301 _UIApplicationMain + 1121
24 myAppName 0x0000260f main (main.m:20)
This app supports iOS 4.3 and later.
I have tried in many ways but can't find proper solution. Anyone have any idea how I resolve this? Should I use some other code for in-app purchase?

EXEC_BAD_ACCESS Error [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How do I set up NSZombieEnabled in Xcode 4?
I am debugging an application and it throws an exec-bad-access error when performing a certain navigation function but only when i run it on a device.
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0xf0000008
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x3421bf78 objc_msgSend + 16
1 UIKit 0x31d9a28c -[UIWebView webView:decidePolicyForNavigationAction:request:frame:decisionListener:] + 68
2 CoreFoundation 0x321ce7dc __invoking___ + 60
3 CoreFoundation 0x321297aa -[NSInvocation invoke] + 154
4 CoreFoundation 0x321293c8 -[NSInvocation invokeWithTarget:] + 44
5 WebKit 0x365f6e06 -[_WebSafeForwarder forwardInvocation:] + 246
6 CoreFoundation 0x321cda7c ___forwarding___ + 660
7 CoreFoundation 0x32128648 _CF_forwarding_prep_0 + 40
8 CoreFoundation 0x321ce7dc __invoking___ + 60
9 CoreFoundation 0x321297aa -[NSInvocation invoke] + 154
10 WebCore 0x358fa1ee _ZL11SendMessageP12NSInvocation + 18
11 WebCore 0x3590d6ea _ZL20HandleDelegateSourcePv + 74
12 CoreFoundation 0x3219facc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 8
13 CoreFoundation 0x3219f298 __CFRunLoopDoSources0 + 208
14 CoreFoundation 0x3219e03e __CFRunLoopRun + 646
15 CoreFoundation 0x3212149e CFRunLoopRunSpecific + 294
16 CoreFoundation 0x32121366 CFRunLoopRunInMode + 98
17 GraphicsServices 0x31278432 GSEventRunModal + 130
18 UIKit 0x31c20cce UIApplicationMain + 1074
19 Parliament 0x0007396a main (main.m:14)
20 Parliament 0x00073928 start + 32
This is the error log. Would anyone know why this is or how i could debug errors such as this since running thruogh an instrument doesnt hep
You possibly have released an object and subsequently try to access that object in your webView:decidePolicyForNavigationAction delegate method.
Enable "Zombie" detection in your debug build settings:
How do I set up NSZombieEnabled in Xcode 4?
This will help you identify if an object is not being properly retained.

Getting to the bottom of crash

I have the following crash that I can't replicate on demand but does happen enough to get noticed by the users.
This crash report has been symbolicated as well. How would you find out the cause!!! This only seems to happen on 4.1
Exception Type: SIGSEGV
Exception Codes: SEGV_ACCERR at 0x9f069184
Crashed Thread: 0
Thread 0 Crashed:
0 libobjc.A.dylib 0x000027d8 objc_msgSend + 16
1 CoreFoundation 0x0007d749 ____CFXNotificationPost_old_block_invoke_1 + 45
2 libSystem.B.dylib 0x000d5984 _dispatch_call_block_and_release + 20
3 libSystem.B.dylib 0x000d66b0 _dispatch_continuation_pop + 72
4 libSystem.B.dylib 0x000d69fc _dispatch_main_queue_callback_4CF + 220
5 CoreFoundation 0x0002789b __CFRunLoopRun + 1335
6 CoreFoundation 0x00027277 CFRunLoopRunSpecific + 231
7 CoreFoundation 0x0002717f CFRunLoopRunInMode + 59
8 GraphicsServices 0x000045f3 GSEventRunModal + 115
9 GraphicsServices 0x0000469f GSEventRun + 63
10 UIKit 0x00004123 -[UIApplication _run] + 403
11 UIKit 0x0000212f UIApplicationMain + 671
12 MyApp 0x000024e3 main (main.m:17)
I have since managed to get a little more info, but not much.
2012-02-12 18:03:04.556 MyApp[462:307] (null): unrecognized selector sent to class 0x3e0a360c
2012-02-12 18:03:04.618 MyApp[462:307] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '(null): unrecognized selector sent to class 0x3e0a360c'
*** Call stack at first throw:
(
0 CoreFoundation 0x33506ed3 __exceptionPreprocess + 114
1 libobjc.A.dylib 0x30412811 objc_exception_throw + 24
2 CoreFoundation 0x335086ff +[NSObject(NSObject) doesNotRecognizeSelector:] + 102
3 CoreFoundation 0x334b01d9 ___forwarding___ + 508
4 CoreFoundation 0x334aff90 _CF_forwarding_prep_0 + 48
5 Foundation 0x302a86b3 _nsnote_callback + 142
6 CoreFoundation 0x334e4749 ____CFXNotificationPost_old_block_invoke_1 + 44
7 libSystem.B.dylib 0x31d05984 _dispatch_call_block_and_release + 20
8 libSystem.B.dylib 0x31d066b0 _dispatch_continuation_pop + 72
9 libSystem.B.dylib 0x31d069fc _dispatch_main_queue_callback_4CF + 220
10 CoreFoundation 0x3348e89b __CFRunLoopRun + 1334
11 CoreFoundation 0x3348e277 CFRunLoopRunSpecific + 230
12 CoreFoundation 0x3348e17f CFRunLoopRunInMode + 58
13 GraphicsServices 0x31b5e5f3 GSEventRunModal + 114
14 GraphicsServices 0x31b5e69f GSEventRun + 62
15 UIKit 0x341bd123 -[UIApplication _run] + 402
16 UIKit 0x341bb12f UIApplicationMain + 670
Now all of my addObservers are block based so I can't see why it would lead to an unrecognised selector.
This way won't help us much while Debugging crash. I found one of the best way to Debug the code for Crash. Follow the link for debugging technique:
https://cocoadev.com/DebuggingAutorelease.html
You need to analyze your Console very carefully to see actually why the Crash occurs. This helped me in almost all of the Code that are without ARC enabled.

SIGABRT crash on __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__

I have a SIGABRT crash log that is unfamiliar to me. Looks like it's throwing an exception, but I can't see where the exception is listed or the root cause of it.
This is running on a customer's iPad 2 / iOS 4.3.
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x33ed3a1c __pthread_kill + 8
1 libsystem_c.dylib 0x354d83b4 pthread_kill + 52
2 libsystem_c.dylib 0x354d0bf8 abort + 72
3 libstdc++.6.dylib 0x33671a64 __gnu_cxx::__verbose_terminate_handler() + 376
4 libobjc.A.dylib 0x3636906c _objc_terminate + 104
5 libstdc++.6.dylib 0x3366fe36 __cxxabiv1::__terminate(void (*)()) + 46
6 libstdc++.6.dylib 0x3366fe8a std::terminate() + 10
7 libstdc++.6.dylib 0x3366ff5a __cxa_throw + 78
8 libobjc.A.dylib 0x36367c84 objc_exception_throw + 64
9 Foundation 0x33f69924 __NSThreadPerformPerform + 648
10 CoreFoundation 0x33e4ba72 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 6
11 CoreFoundation 0x33e4d758 __CFRunLoopDoSources0 + 376
12 CoreFoundation 0x33e4e4e4 __CFRunLoopRun + 224
13 CoreFoundation 0x33ddeebc CFRunLoopRunSpecific + 224
14 CoreFoundation 0x33ddedc4 CFRunLoopRunInMode + 52
15 GraphicsServices 0x33544418 GSEventRunModal + 108
16 GraphicsServices 0x335444c4 GSEventRun + 56
17 UIKit 0x34416d62 -[UIApplication _run] + 398
18 UIKit 0x34414800 UIApplicationMain + 664
19 MyApp 0x000190c4 main (main.m:14)
20 MyApp 0x0001907c 0x18000 + 4220
Where would I start looking to diagnose this?
The program should print information about the exception to the device console (viewable in the Xcode organizer when the device is connected). It would be very, very helpful to see this information.
_NSThreadPerformPerform is used by the performSelector... family of methods. So look at your use of those methods. In particular, figure out if it's possible that you're asking an object to perform a selector that it doesn't support. That would throw an exception.