Unable to Symbolicate iOS App Crash Report - ios

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!

Related

Flutter on ios simulator crash with error after `Configuring the default Firebase app`

I use codemagic to test my app on a simulator.
the app takes more than half an hour to build and when I try to do flutter run I get
Configuring the default Firebase app...
*** First throw call stack:
(
0 CoreFoundation 0x000000010b9adcce __exceptionPreprocess + 350
1 libobjc.A.dylib 0x000000010b8199b2 objc_exception_throw + 48
2 CoreFoundation 0x000000010b9adb0c +[NSException raise:format:] + 188
3 Runner 0x0000000101dac652 +[FIRApp configure] + 130
4 Runner 0x00000001023c64b9 -[FLTCloudFirestorePlugin init] + 217
5 Runner 0x00000001023c62c6 +[FLTCloudFirestorePlugin registerWithRegistrar:] + 262
6 Runner 0x0000000101d477ff +[GeneratedPluginRegistrant registerWithRegistry:] + 207
7 Runner <…>
NOTE: I was following this tutorial https://blog.codemagic.io/remote-access-to-virtual-mac-build-machine/

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.

Stacktrace is no longer symbolicated

I do my own error handling by catching any exceptions and logging them manually. I use NSSetUncaughtExceptionHandler(&myExceptionHandler); and log the stack trace using [NSException callStackSymbols]. Up until recently my logs contained the symbolicated stack trace. Now they don't and there weren't any code changes related to the logging. This is occurring on all devices and versions of iOS. I am able to manually symbolicate my logs but it is quite cumbersome. Any insight would be greatly appreciated.
Previously my logs looked like:
0 libobjc.A.dylib 0x352925b0 objc_msgSend + 16
1 MYAPP 0x0006573a -[MyViewController(Images) didReceiveImage:context:etag:expires:] + 42
2 MYAPP 0x0004fb26 -[MyImageTask didReceiveImage:] + 98
3 Foundation 0x361ac8e8 __NSThreadPerformPerform
4 CoreFoundation 0x3b37d680 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
5 CoreFoundation 0x3b37cee4 __CFRunLoopDoSources0
6 CoreFoundation 0x3b37bcb2 __CFRunLoopRun
7 CoreFoundation 0x3b2eeeb8 CFRunLoopRunSpecific
8 CoreFoundation 0x3b2eed44 CFRunLoopRunInMode
9 GraphicsServices 0x396bc2e6 GSEventRunModal
10 UIKit 0x3452e2f4 UIApplicationMain
11 MYAPP 0x0004934a main + 70
12 MYAPP 0x000492fc start + 36
After my last release they look like:
0 libobjc.A.dylib 0x352925b0 objc_msgSend + 16
1 MYAPP 0x0006573a - MYAPP + 42
2 MYAPP 0x0004fb26 - MYAPP + 98
3 Foundation 0x361ac8e8 __NSThreadPerformPerform
4 CoreFoundation 0x3b37d680 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
5 CoreFoundation 0x3b37cee4 __CFRunLoopDoSources0
6 CoreFoundation 0x3b37bcb2 __CFRunLoopRun
7 CoreFoundation 0x3b2eeeb8 CFRunLoopRunSpecific
8 CoreFoundation 0x3b2eed44 CFRunLoopRunInMode
9 GraphicsServices 0x396bc2e6 GSEventRunModal
10 UIKit 0x3452e2f4 UIApplicationMain
11 MYAPP 0x0004934a main + 70
12 MYAPP 0x000492fc start + 36
Looks like Apple now performs a kind of repackaging and eventually stripping debug info.

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".

iOS Cordova app crashes on startup with NSInvalidArgumentException

We are keeping getting a strange error on when starting a cordova app
Apache Cordova native platform version 4.1.1 is starting.
[__NSDictionaryM cordovaSettingForKey:]: unrecognized selector sent to instance 0x7fef81d10e00
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSDictionaryM cordovaSettingForKey:]: unrecognized selector sent to instance 0x7fef81d10e00'
*** First throw call stack:
(
0 CoreFoundation 0x0000000105fdcd85 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000105a50deb objc_exception_throw + 48
2 CoreFoundation 0x0000000105fe5d3d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x0000000105f2bcfa ___forwarding___ + 970
4 CoreFoundation 0x0000000105f2b8a8 _CF_forwarding_prep_0 + 120
5 שוליק.נט 0x0000000105527ab3 -[CDVViewController viewDidLoad] + 195
6 שוליק.נט 0x0000000105525a06 -[MainViewController viewDidLoad] + 54
7 UIKit 0x0000000106bf5984 -[UIViewController loadViewIfRequired] + 1198
8 UIKit 0x0000000106bf5cd3 -[UIViewController view] + 27
9 UIKit 0x0000000106acbfb4 -[UIWindow addRootViewControllerViewIfPossible] + 61
10 UIKit 0x0000000106acc69d -[UIWindow _setHidden:forced:] + 282
11 UIKit 0x0000000106ade180 -[UIWindow makeKeyAndVisible] + 42
12 שוליק.נט 0x000000010552b188 -[CDVAppDelegate application:didFinishLaunchingWithOptions:] + 776
Recently I had the same problem with a Visual Studio TACO project. In particular this appeared when updated the Cordova CLI platform version from 5.1.1 to 6.1.1. This resulted in the modification of the native version of iOS Cordova from the 3.8.2 to 4.1.1 which produced the problem commented.
After many tests I found the solution. The problem was caused by file 'build.xconfig' located in '[project_folder]/res/native/ios/cordova'. After delete this file and recompile the project the problem was solved.

Resources