Xcode cannot symbolicate my crash logs even though I have correct .dSYM file - ios

I have been observing this that when ever my app crashes i get the crash log and try to symbolicate it but following happen
When I use xcode to symbolicate, it never symbolicates the addresses of the crash
When I use atos command specified developer.apple.com technotes it either gives some other class function name that does not have to do any thing with the crash
I have used other methods like symbolicatecrash script but the result is same as before.
I also tried solution given stackoverflow.com/questions/7932992 but did not succeed
I created a demo crash and tried to change my scheme of the app for "Run" and changed "build configuration" to "release" to check if the crashes symbolicate when I run the app directly to device, I test the app, the demo crash occurs and in this case the crahes get symbolicated.
I created a demo crash in a new app and created an archive and export IPA, used this ipa in a device to recreate that crash but still xcode could not symbolicate that crash.
I don't get why is it behaving this way,
I looked into the archives to find my dSYM file and can locate it there but could not symbolicate it using any of the processes stated above.
A guidance will be helpful!

I was working with code back to see if there can be any impact of bitcode with help of a friend, found that while exporting archive to IPA, it asks me to rebuild with bitcode (which was checked) I just tried and unchecked it to create the IPA and this time my app crash logs were symbolicated, I still don't know why this happens because apple recomends to rebuild with bitcode while submitting apps.
I am looking for more answeres for why is it happening?
Will keep you posted (also a enlighten me if there are any misses.)

Related

Getting Crashlytics DSYMs for debug apps

How can i get the DSYMs for a debugged app (no released on the AppStore) ?...
I know from this answer that the debug session is not allowed to report crashes and errors to Fabric, but after i disconnect the device from xcode, my crash logs are reported and requires DSYMs, how can i get them in this case ?
also note that i am logging non fatal errors using Crashlytics.recordError(error) and not forcing a crash.
Mike from Fabric here. Make sure that you have Debug Information Format set to "Dwarf with dSYM" and that your run script is enabled to run on all builds to get the dSYMs uploaded.

Empty dSYM folder in Xcode archive

I've Googled this extensively, and either the situation someone's experiencing involves a different Xcode version (and therefore different build options), or a presence of a dSYM file.
So, here's the situation. I received a crash report through Xcode. It's just memory addresses. Trying to open it in project gives me the same memory addresses. Thought about manual symbolication but for that I need my dSYM file corresponding to the archive I built. But when I 'Show package contents' for the archive I built in finder, its dSYM folder is empty.
My Xcode settings at the time of archiving were:
DEBUG_INFORMATION_FORMAT: DWARF with dSYM File
STRIP_INSTALLED_PRODUCT: Yes Switching to No makes no difference.
DEPLOYMENT_POSTPROCESSING: No Switching to Yes makes no difference.
Also, I selected 'Include symbols' when uploading the archive to iTunes Connect.
The process for deployment with Apple is confusing-as-hell enough, without having to worry that when a crash does happen, the resport is in fact readable!
So my questions are:
1) Why was my archive missing a dSYM file?
2) If the dSYM file would've been generated, where could it be?
3) If I really do not have a dSYM file, can I still somehow get human-readable symbol names? I've got the original archive I uploaded and access to source code for that build.
3a) If I Product>Archive again (and assuming this time a dSYM does get generated), can I use this dSYM file instead? Or will it have a different UUID, causing it to be incompatible with the crash log cause...well...Apple?
Xcode version: 6.4
Here's what my crash log looks like in Xcode Organizer:
Thanks.
EDIT:
I upgraded to Xcode 7.3 before trying this but it may also work for version 6.
The solution to question (1) is to set the following in project build settings:
GCC_GENERATE_DEBUGGING_SYMBOLS
On XCode 8.3.2, select Yes on Generate Debug Symbols
For question 1), I also don't know. It may be a bug of Xcode. You can archive
the same code again, then generate a same dSYM file.
For question 2), you can search 'dSYM' in the folder '~/Library', because 'dSYM' file output in there generally. If not found, try searching it in the entire disk.
For question 3), you must have the system library symbol file that the crash log listed in 'Binary Images' section. You can find it in '~/Library/Developer/Xcode/iOS DeviceSupport'. If not found, you can connect an iPhone with the same OS version showed in the crash log to Xcode. After Xcode finished processing it, the system library symbol file of the iPhone can be copied to the folder. Then, you can re-symbolicate the crash log.
For question 3a), For the same app code, different Archive may be have a different dSYM file(UUID). If you use it to symbolicate the crash log, the symbolicated crash line is very close to the real crash line, so this can also help you to infer the real cause of crash.
From your screenshot, there only one line from your app code not be symbolicated. Now, you can generate the dSYM file of your app through using the app code which causes the crash to archive again. After you generate the dSYM file, use command line dwarfdump -u yourApp.app.dSYM to get UUID of it,Then check the uuid if contained in the first line of 'Binary images''. If NO, you can modify the UUID in the first line of 'Binary images'' to same as the new UUID which got from dwarfdump -u XXX.dSYM, Note the cpu architecture. Finish this, you can re-symbolicate the crash log in Xcode, or use command line symbolicatecrash crashreport.crash yourApp.app.dSYM. Note, you must guarantee the version of your app code same as version in the crash log, if not, the result is unbelievable.

Find where iOS is crashing based on crash reports

I have an app in beta using TestFlight and I have been noticing crash reports appearing.
most of the reports are this
If I click on the button Open in project in the Organizer it takes me no where
This appears to be an internal crash correct?
How can I find out what UIBarButtonItem is causing the crash?
I Hope this will help you: Apple doc Crash Report , as you can see in the doc in the Listing 4 the crash report is fully symbolicated , Listing 6 shows partially symbolicated crash reports which looks like your case
From Apple Doc
You must keep both the application binary and the .dSYM file in order to be able to fully symbolicate crash reports. You should archive these files for every build that you submit to iTunes Connect. The .dSYM and application binary are specifically tied together on a per-build-basis, and subsequent builds, even from the same source files, will not interoperate with files from other builds. If you use Xcode's Build and Archive command then they will be placed in a suitable location automatically. Otherwise any location searchable by Spotlight (such as your home directory) is fine.
For more information about this you can check portion after Listing 6 in Symbolication
you can use crashlytics for identifying where the app is crashed.It will give the Controller name and line number of code also.
https://docs.fabric.io/ios/index.html Document
Easy to add your project also

What is the proper "Strip Debug Symbols" settings in iOS for release versions?

I've been getting a bunch of crash logs for my (largely c++) app on iOS. My problem is I can't seem to ever symbolicate these crash reports properly.
What is the "proper" setting for stripping debug symbols for release on iOS? I get that you'd want to strip the debug symbols so the download size of the app isn't ridiculously large.
But the problem is that it seems to make the crash reports virtually unreadable.
Do dSYM files on the xcode archives get sent and eventually downloaded by the users?
Or is it simply something to be kept for future symbolicating purposes (done locally on my own machine, on xcode)?
Or is it simply something to be kept for future symbolicating purposes (done locally on my own machine, on Xcode)?
This. Your "release" config (or whichever config you use for distribution) should have the following setting:
Symbols Hidden by Default: Yes
Xcode will still generate a dSYM folder which is what you will use for symbolicating crash logs. There are 3 ways to handle symbolicating:
Use Xcode. For this you need to use the Product -> Archive feature whenever you release. Once an archive is created, you can select "Export" then "Save for iOS App Store Deployment". After this you can drag crash logs into the left side of the "Device Logs" window and Xcode will symbolicate them for you.
Manually symbolicate using the symbolicatecrash tool located inside your Xcode.app folder. This is useful if you've released code to users but don't have an Xcode archive. You need to be sure that the crash log matches the binary and dSYM or it will not work.
Use a third party tool that collects crash reports and symbolicates them for you. Examples include Crashlytics, Bugsense, or HockeyApp.

Symbolized Crash Reports on Debug Build

There is a build setting that says "Symbols Hidden By Default" that I have set to NO on my Debug build, but I'm still not getting symbolized crashes on my devices. Is this just not possible on ios ?. I know that on mac it is, but maybe there is another setting I'm missing ?
Thank you.
Symbolication will only work, if you did not start another build process after deploying a build onto your device. Each build will generate a unique combination of app binary and dSYM file with the same UUIDs. This ID is set in the crash report and used to find the correct dSYM to resolve the symbols in the crash report.
If you build again, these files get replaced and because of that get a new UUID also. So the symbolication process can not find the corresponding files and will not resolve the app specific symbols. The iOS symbols should work fine though.

Resources