Fabric SDK Crash [ANSAnswersController logCrashEvent:] - ios

Fatal Exception: NSInvalidArgumentException
*** +[NSJSONSerialization dataWithJSONObject:options:error:]: value parameter is nil
Foundation +[NSJSONSerialization dataWithJSONObject:options:error:] + 84
ProjectName -[ANSWriteEventOperation logLineWithTimestamp:eventName:payloadDictionary:] + 72
ProjectName -[ANSWriteEventOperation generateFormattedLogLineWithMetdata:timestamp:] + 142
ProjectName -[ANSWriteEventOperation initWithEvent:metadata:logFileUrl:] + 200
ProjectName
__38-[ANSAnswersController logCrashEvent:]_block_invoke + 600
Foundation NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK + 8

This has been fixed in 3.8.2 as per the Crashlytics developers. See this speicific developer comment https://twittercommunity.com/t/crash-io-answers-eventqueue-nsoperation-qos-background/74765/7

Related

FirebaseApp.configure() crashes for unit test target

I've encountered a strange problem where the FirebaseApp.configure() call causes my app to instantly crash for my unit test target. It runs just fine for my standard builds.
Any ideas why this is happening?
Here's the stack trace:
2018-04-18 11:42:57.252405+0100 Avalanche[14289:124354] 4.8.1 - [Firebase/Analytics][I-ACS023007] Firebase Analytics v.40007000 started
2018-04-18 11:42:57.252454+0100 Avalanche[14289:124361] 4.8.1 - [Firebase/Core][I-COR000005] No app has been configured yet.
2018-04-18 11:42:57.252712+0100 Avalanche[14289:124354] 4.8.1 - [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://googl/RfcP7r)
2018-04-18 11:42:57.371588+0100 Avalanche[14289:124278] [Crashlytics] Version 3.9.3 (128)
2018-04-18 11:42:57.390507+0100 Avalanche[14289:124278] *** Terminating app due to uncaught exception 'FABException', reason: '[Fabric] Value of Info.plist key "Fabric" must be a NSDictionary.'
*** First throw call stack:
(
0 CoreFoundation 0x0000000113c0a1e6 __exceptionPreprocess + 294
1 libobjc.A.dylib 0x000000011329f031 objc_exception_throw + 48
2 CoreFoundation 0x0000000113c7f975 +[NSException raise:format:] + 197
3 Avalanche 0x000000010f654dec -[Fabric validFabricConfigFromInfoPlist:] + 353
4 Avalanche 0x000000010f654a16 -[Fabric fabricConfig] + 127
5 Avalanche 0x000000010f654bce -[Fabric APIKey] + 392
6 Avalanche 0x000000010f61e6d7 -[Crashlytics APIKey] + 55
7 Avalanche 0x000000010f62a087 -[CLSCrashReportingController APIKey] + 57
8 Avalanche 0x000000010f62977f -[CLSCrashReportingController startWithProfilingMark:betaToken:] + 257
9 Avalanche 0x000000010f61e088 __20-[Crashlytics start]_block_invoke + 637
10 libdispatch.dylib 0x0000000114b93779 _dispatch_client_callout + 8
11 libdispatch.dylib 0x0000000114b94c0a dispatch_once_f + 55
12 Avalanche 0x000000010f61de05 -[Crashlytics start] + 106
13 Avalanche 0x000000010f61e23a +[Crashlytics initializeIfNeeded] + 48
14 Avalanche Tests 0x0000000129cd440a __15+[Fabric with:]_block_invoke + 538
15 libdispatch.dylib 0x0000000114b93779 _dispatch_client_callout + 8
16 libdispatch.dylib 0x0000000114b94c0a dispatch_once_f + 55
17 Avalanche Tests 0x0000000129cd41ee +[Fabric with:] + 222
18 Avalanche Tests 0x0000000129cd5dea __14+[Fabric load]_block_invoke + 580
19 Foundation 0x0000000112cc0324 -[__NSObserver _doit:] + 298
20 CoreFoundation 0x0000000113ba5b8c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
21 CoreFoundation 0x0000000113ba5a65 _CFXRegistrationPost + 453
22 CoreFoundation 0x0000000113ba57a1 ___CFXNotificationPost_block_invoke + 225
23 CoreFoundation 0x0000000113b67422 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1826
24 CoreFoundation 0x0000000113b665a1 _CFXNotificationPost + 609
25 Foundation 0x0000000112c80e57 -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
26 Avalanche 0x000000010f6d41a7 +[FIRApp sendNotificationsToSDKs:] + 393
27 Avalanche 0x000000010f6d309e +[FIRApp configureDefaultAppWithOptions:sendingNotifications:] + 302
28 Avalanche 0x000000010f6d2eda +[FIRApp configure] + 380
29 Avalanche 0x000000010f609490 _T09Avalanche11AppDelegateCACycfc + 192
30 Avalanche 0x000000010f6094c3 _T09Avalanche11AppDelegateCACycfcTo + 19
31 UIKit 0x00000001109eb6c4 _UIApplicationMainPreparations + 1491
32 UIKit 0x00000001109eb087 UIApplicationMain + 111
33 Avalanche 0x000000010f60b447 main + 55
34 libdyld.dylib 0x0000000114c08955 start + 1
)
li
bc++abi.dylib: terminating with uncaught exception of type NSException
Before the crash, I also see a large number of log entries like:
objc[14289]: Class RCNKeyValue is implemented in both /Users/sammcneilly/Library/Developer/CoreSimulator/Devices/E62EC87E-0B07-4A83-A165-819E693AEB87/data/Containers/Bundle/Application/6C3F993F-4CEB-462F-9257-0F3C8E088BC0/Avalanche.app/Avalanche (0x10f7bdd50) and /Users/sammcneilly/Library/Developer/Xcode/DerivedData/Avalanche-ewiqmxxekhpknrhhfuyljlekgzat/Build/Products/Development-iphonesimulator/Avalanche.app/PlugIns/Avalanche Tests.xctest/Avalanche Tests (0x129e075d8). One of the two will be used. Which one is undefined.
I've installed Firebase and Firebase/Crashlytics via CocoaPods.
I'm not sure if this is related to Xcode 9.3 - this is happening on two separate projects, and I'm fairly certain it didn't happen previously for the older project.
I've printed out the bundle contents and the GoogleService-Info.plist file appears to be there.
Any help would be much appreciated!
Ok so this turned out to be caused by an incorrectly-configured Pod file.
My main target and unit test target were configured to use the following pods:
pod 'Crashlytics', '~> 3.10.1'
pod 'Fabric', '~> 1.7.6'
pod 'Firebase/Core', '~> 4.8'
pod 'FirebaseRemoteConfig', '~> 2.1'
Removing the additional Firebase pods for the test target ONLY (other than Firebase/Core) and running pod install again helped.
I'm not altogether sure why this worked, so would be very grateful if someone could explain this to me.
The "${PODS_ROOT}/Fabric/run" build phase script was configured on my primary target as detailed in Google's docs here: https://firebase.google.com/docs/crashlytics/get-started, and adding it to the test target didn't help either...
Thanks to everyone for their input, but adding the Fabric details manually to the Info.plist file just caused a build error. I believe this step is automatically handled for Firebase.
We had the same crash when running XCTest. We use the following to get around it.
if NSClassFromString("XCTest") != nil {
return true
} else {
FirebaseApp.configure()
}
Put this code in info.plist
<key>Fabric</key>
<dict>
<key>APIKey</key>
<string>YOUR APIKEY</string>
<key>Kits</key>
<array>
<dict>
<key>KitInfo</key>
<dict/>
<key>KitName</key>
<string>Crashlytics</string>
</dict>
</array>
</dict>
Hope it's helps.!

What is wrong with creating a React Native app this way?

I'm trying to create a basic React Native app. While I can create the project, it will not run inside the simulator.
After the app loads, it immediately quits. If I remove node_modules and do npm install to download all the modules fresh, I will see the app reload the Javascript. Then when it hits 100%, it immediately quits again.
The steps I used to create the app are as follows:
$ react-native init demo1
$ cd demo1
$ react-native run-ios
That's literally it. I'm using the following versions of tools:
$ node --version
v6.11.2
$ npm --version
3.10.10
$ react-native --version
react-native-cli: 2.0.1
react-native: 0.48.0
The full log is here. What am I doing wrong?
Investigating this more, it turns out the Xcode project fails with a stack trace:
2017-09-02 13:03:00.775 [info][tid:main][RCTCxxBridge.mm:188] Initializing <RCTCxxBridge: 0x6080001a2ae0> (parent: <RCTBridge: 0x6000000a1f80>, executor: (null))
2017-09-02 13:03:00.804 [warn][tid:main][RCTBridge.m:114] Class RCTCxxModule was not exported. Did you forget to use RCT_EXPORT_MODULE()?
2017-09-02 13:03:00.825 [info][tid:main][RCTRootView.m:301] Running application r1 ({
initialProps = {
};
rootTag = 1;
})
2017-09-02 13:03:00.960 r1[47802:5600672] -[NSTaggedPointerString unsignedIntValue]: unrecognized selector sent to instance 0xa313434323930327
2017-09-02 13:03:00.977 r1[47802:5600672] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSTaggedPointerString unsignedIntValue]: unrecognized selector sent to instance 0xa313434323930327'
*** First throw call stack:
(
0 CoreFoundation 0x000000010e094b0b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010cf4a141 objc_exception_throw + 48
2 CoreFoundation 0x000000010e104134 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x000000010e01b840 ___forwarding___ + 1024
4 CoreFoundation 0x000000010e01b3b8 _CF_forwarding_prep_0 + 120
5 r1 0x000000010c301394 -[RCTMultipartStreamReader emitProgress:contentLength:final:callback:] + 244
6 r1 0x000000010c301b8a -[RCTMultipartStreamReader readAllPartsWithCompletionCallback:progressCallback:] + 1610
7 r1 0x000000010c3514bc -[RCTMultipartDataTask URLSession:streamTask:didBecomeInputStream:outputStream:] + 444
8 CFNetwork 0x000000010daf4c51 __88-[NSURLSession delegate_streamTask:didBecomeInputStream:outputStream:completionHandler:]_block_invoke + 51
9 Foundation 0x000000010ca543b7 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 7
10 Foundation 0x000000010ca540bb -[NSBlockOperation main] + 101
11 Foundation 0x000000010ca52877 -[__NSOperationInternal _start:] + 627
12 Foundation 0x000000010ca4e5fc __NSOQSchedule_f + 198
13 libdispatch.dylib 0x0000000111d7605c _dispatch_client_callout + 8
14 libdispatch.dylib 0x0000000111d5494f _dispatch_queue_serial_drain + 221
15 libdispatch.dylib 0x0000000111d55669 _dispatch_queue_invoke + 1084
16 libdispatch.dylib 0x0000000111d57ec4 _dispatch_root_queue_drain + 634
17 libdispatch.dylib 0x0000000111d57bef _dispatch_worker_thread3 + 123
18 libsystem_pthread.dylib 0x000000011210d5a2 _pthread_wqthread + 1299
19 libsystem_pthread.dylib 0x000000011210d07d start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Is this some sort of bug or is this something I did?
This seems to be a 0.48 issue. Try using 0.47.1 and you should be fine.
react-native init demo1 --version react-native#0.47.1
This issue has been fixed in RN 0.48.1. If you create a new project (as of September 4, 2017) you shouldn't run into this issue.

I can't run my react-native app on ios Xcode

I'm having a real issue with running my react-native ios app. I installed Xcode (version 8.3.3) and all the other basic dependencies needed, all I did was:
react-native init AwesomeProject
cd AwesomeProject
react-native run-ios
And what happens is the AwesomeProject app opens for a second then closes. I also tried running it through xcode and get the same problem, although it is atleast reporting an error of:
2017-09-04 20:38:11.369 [info][tid:main][RCTCxxBridge.mm:188]
Initializing <RCTCxxBridge: 0x6000001a0540> (parent: <RCTBridge: 0x6000000a9a20>, executor: (null))
2017-09-04 20:38:11.390 [warn][tid:main][RCTBridge.m:114] Class RCTCxxModule was not exported. Did you forget to use RCT_EXPORT_MODULE()?
2017-09-04 20:38:11.404 [info][tid:main][RCTRootView.m:301] Running application AwesomeProject ({
initialProps = {
};
rootTag = 1;
})
2017-09-04 20:38:11.467 AwesomeProject[10363:1261593] -[NSTaggedPointerString unsignedIntValue]: unrecognized selector sent to instance 0xa383534303930327
2017-09-04 20:38:11.509 AwesomeProject[10363:1261593] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSTaggedPointerString unsignedIntValue]: unrecognized selector sent to instance 0xa383534303930327'
*** First throw call stack:
(
0 CoreFoundation 0x000000010e4f4b0b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010d3aa141 objc_exception_throw + 48
2 CoreFoundation 0x000000010e564134 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x000000010e47b840 ___forwarding___ + 1024
4 CoreFoundation 0x000000010e47b3b8 _CF_forwarding_prep_0 + 120
5 AwesomeProject 0x000000010c7653f4 -[RCTMultipartStreamReader emitProgress:contentLength:final:callback:] + 244
6 AwesomeProject 0x000000010c765bea -[RCTMultipartStreamReader readAllPartsWithCompletionCallback:progressCallback:] + 1610
7 AwesomeProject 0x000000010c7b551c -[RCTMultipartDataTask URLSession:streamTask:didBecomeInputStream:outputStream:] + 444
8 CFNetwork 0x000000010df54c51 __88-[NSURLSession delegate_streamTask:didBecomeInputStream:outputStream:completionHandler:]_block_invoke + 51
9 Foundation 0x000000010ceb43b7 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 7
10 Foundation 0x000000010ceb40bb -[NSBlockOperation main] + 101
11 Foundation 0x000000010ceb2877 -[__NSOperationInternal _start:] + 627
12 Foundation 0x000000010ceae5fc __NSOQSchedule_f + 198
13 libdispatch.dylib 0x00000001121d605c _dispatch_client_callout + 8
14 libdispatch.dylib 0x00000001121b494f _dispatch_queue_serial_drain + 221
15 libdispatch.dylib 0x00000001121b5669 _dispatch_queue_invoke + 1084
16 libdispatch.dylib 0x00000001121b7ec4 _dispatch_root_queue_drain + 634
17 libdispatch.dylib 0x00000001121b7bef _dispatch_worker_thread3 + 123
18 libsystem_pthread.dylib 0x000000011256d5a2 _pthread_wqthread + 1299
19 libsystem_pthread.dylib 0x000000011256d07d start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
And I then get brought to this page with the following Thread 8: signal SIGABRT error:
-> 0x112538d42 <+10>: jae 0x112538d4c ; <+20>
I have googled a lot with regards to the NSEXCEPTION yet I still cannot seem to even run my app. Any help would be much appreciated
Apparently there's an issue with react-native 0.48.0.
You can follow the thread below, it should be fixed with 0.48.1.
https://github.com/facebook/react-native/issues/15768
Edit: I can confirm 0.48.1 works fine. Update using:
npm install -g react-native-git-upgrade
react-native-git-upgrade

Why does not xcode show source file while `Terminating app due to uncaught exception `?

2016-10-28 16:59:42.288 HuaYang[16997:681263] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[HYNewGiftInfoModel id]: unrecognized selector sent to instance 0x6080000f8200'
*** First throw call stack:
(
0 CoreFoundation 0x000000010efa834b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010dfb821e objc_exception_throw + 48
2 CoreFoundation 0x000000010f017f34 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x000000010ef2dc15 ___forwarding___ + 1013
4 CoreFoundation 0x000000010ef2d798 _CF_forwarding_prep_0 + 120
5 HuaYang 0x000000010abdecdb HuaYang + 4332763
6 HuaYang 0x000000010ab7a99e HuaYang + 3922334
7 UIKit 0x0000000111d5edd0 -[UICollectionView _createPreparedCellForItemAtIndexPath:withLayoutAttributes:applyAttributes:isFocused:notify:] + 467
8 UIKit 0x0000000111d5ebf7 -[UICollectionView _createPreparedCellForItemAtIndexPath:withLayoutAttributes:applyAttributes:] + 35
9 UIKit 0x0000000111d640cf -[UICollectionView _updateVisibleCellsNow:] + 4803
10 UIKit 0x0000000111d69d63 -[UICollectionView layoutSubviews] + 313
11 UIKit 0x00000001114e1344 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1237
12 QuartzCore 0x000000011115ccdc -[CALayer layoutSublayers] + 146
13 QuartzCore 0x00000001111507a0 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366
14 QuartzCore 0x000000011115061e _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
15 QuartzCore 0x00000001110de62c _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 280
16 QuartzCore 0x000000011110b713 _ZN2CA11Transaction6commitEv + 475
17 UIKit 0x0000000111416067 _UIApplicationFlushRunLoopCATransactionIfTooLate + 206
18 UIKit 0x0000000111c25b30 __handleEventQueue + 5672
19 CoreFoundation 0x000000010ef4d311 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
20 CoreFoundation 0x000000010ef32517 __CFRunLoopDoSources0 + 423
21 CoreFoundation 0x000000010ef31a86 __CFRunLoopRun + 918
22 CoreFoundation 0x000000010ef31494 CFRunLoopRunSpecific + 420
23 GraphicsServices 0x0000000113b50a6f GSEventRunModal + 161
24 UIKit 0x000000011141cf34 UIApplicationMain + 159
25 HuaYang 0x000000010a9514cf HuaYang + 1656015
26 libdyld.dylib 0x0000000112db968d start + 1
5 HuaYang 0x000000010abdecdb HuaYang + 4332763
My own code has no function name, while the system library has.
Is there any xcode build switch I need to turn on to show the symbol while my app crash?
Steps to analyze crash report from apple:
Copy the release .app file which was pushed to the appstore, the .dSYM file that was created at the time of release and the crash report receive from APPLE into a FOLDER.
OPEN terminal application and go to the folder created above (using cd command)
Run atos -arch armv7 -o APPNAME.app/APPNAME MEMORY_LOCATION_OF_CRASH. The memory location should be the one at which the app crashed as per the report.
Ex: atos -arch armv7 -o 'APPNAME.app'/'APPNAME' 0x0003b508
This would show you the exact line, method name which resulted in crash.
Ex: [classname functionName:]; -510
Symbolicating IPA
if we use IPA for symbolicating - just rename the extention .ipa with .zip , extract it then we can get a Payload Folder which contain app. In this case we don't need .dSYM file.
Note
This can only work if the app binary does not have symbols stripped. By default release builds stripped the symbols. We can change it in project build settings "Strip Debug Symbols During Copy" to NO.
More details see this post
You can choose "Exception Breakpoint..." in Breakpoint panel, and then choose "All exceptions".

Unable to Symbolicate iOS App Crash Report

My app is occasionally crashing for some users and I have been unable to replicate the problem.
I have managed to get a few crash reports from one of the users which I have imported to Xcode, but I am unable to symbolicate the reports fully with some of the myApp lines not showing the actual class/code being called. Two sample stack traces extracts:
Last Exception Backtrace:
0 CoreFoundation 0x39e5c3e2 __exceptionPreprocess + 158
1 libobjc.A.dylib 0x38eb595e objc_exception_throw + 26
2 CoreFoundation 0x39da66d0 -[__NSPlaceholderArray initWithObjects:count:] + 160
3 CoreFoundation 0x39da6e04 +[NSArray arrayWithObject:] + 40
4 myApp 0x0012117c 0x63000 + 778620
5 myApp 0x0012c700 0x63000 + 825088
6 myApp 0x00148784 0x63000 + 939908
7 myApp 0x0013caf0 0x63000 + 891632
8 myApp 0x0013b9da 0x63000 + 887258
9 myApp 0x0006bda2 -[myAppAppDelegate init] (myAppAppDelegate.m:45)
10 UIKit 0x3380d8aa -[UIClassSwapper initWithCoder:] + 186
Last Exception Backtrace:
0 CoreFoundation 0x39e5c3e2 __exceptionPreprocess + 158
1 libobjc.A.dylib 0x38eb595e objc_exception_throw + 26
2 CoreFoundation 0x39da66d0 -[__NSPlaceholderArray initWithObjects:count:] + 160
3 CoreFoundation 0x39da6e04 +[NSArray arrayWithObject:] + 40
4 myApp 0x000c217c 0x4000 + 778620
5 myApp 0x000cd700 0x4000 + 825088
6 myApp 0x000e9784 0x4000 + 939908
7 myApp 0x000ddaf0 0x4000 + 891632
8 myApp 0x000dc9da 0x4000 + 887258
9 myApp 0x0000cda2 -[myAppAppDelegate init] (myAppAppDelegate.m:45)
10 UIKit 0x3380d8aa -[UIClassSwapper initWithCoder:] + 186
This is an app submitted to the store from an archived build which still exists in Xcode. I have also tried the atos command, and running several of the symbolicate scripts available with no success. (I am 100% sure I have the correct .app and .dSYM files).
Anyone have any idea how I may be able to find out more info about these stack traces and determine where this crash is happening?
(Note: I am aware that line 9 references the app delegate's init command, which is very useful. My question is specifically regarding the subsequent calls that are not symbolicated)
Thanks!

Resources