How to get the source file line and column information from a crashlytics stack trace line pointing to index.android.bundle:474:6500?
A crashlytics report stack trace text looks similar to:
Non-fatal Exception: io.invertase.firebase.crashlytics.UnhandledPromiseRejection: undefined is not an object (evaluating 't.includes')
at .removeFile(index.android.bundle:474:6500)
at .<unknown>(index.android.bundle:758:3472)
at .y(index.android.bundle:105:596)
at .<unknown>(index.android.bundle:105:2546)
at .y(index.android.bundle:105:596)
at .o(index.android.bundle:105:1483)
at .<unknown>(index.android.bundle:105:1626)
at .f(index.android.bundle:101:155)
at .<unknown>(index.android.bundle:101:1012)
at .y(index.android.bundle:107:657)
at .C(index.android.bundle:107:1021)
at .callImmediates(index.android.bundle:107:3216)
at .callImmediates([native code]:0:0)
at .value(index.android.bundle:25:3080)
at .<unknown>(index.android.bundle:25:1264)
at .value(index.android.bundle:25:2772)
at .value(index.android.bundle:25:1234)
at .value([native code]:0:0)
at .value([native code]:0:0)
I tried stack-beautifier with limited success. Is there a more reliable method?
I spent days trying to figure out a good solution. This is the best I have found so far.
1) Build Source Maps from Git Tag or Commit Hash Corresponding to Version from Crashlytics Report
iOS
Android builds automatically from build gradle
Or manually build:
2) Usage metro-symbolicate
Open crash report in your Google Firebase Console
Select Stack Trace tab
Select TXT tab and save text to file named mytrace.txt
Remove all stack trace lines starting with first line containing "[native code]" as the "[native code]" seems to cause problems
Results example: error originates at Utility.js:567
I hope this may help others.