Google Play stack trace points the cause of crash at:
com.facebook.react.modules.core.JavascriptException: addWaypointDone
index.android.bundle:424:4194
I extracted index.android.bundle from the apk.
How do I get a JS source code line number from 424:4194 ?
Thanks Daniel. Your approach worked for me from the command-line!
I tried adding this to android/app/react.gradle but I could not find and source.map file under the ./android directory.
commandLine "react-native", "bundle", "--platform", "android", "--dev", "${devEnabled}”,
"--sourcemap-output", "source.map",
"--entry-file", entryFile, "--bundle-output", jsBundleFile, "--assets dest", resourcesDir
Is there a way to auto-build source.map file very time?
Thanks in advance,
To get an exact position you need a source map. If you don't keep those for your deploys you can regenerate it.
react-native bundle --entry-file index.android.js --platform android --dev false --sourcemap-output source.map --bundle-output main.jsbundle
(make sure you use the exact same dependency versions you used in your release)findpos.js
containing the following code:findpos.js
var sourceMap = require('source-map');
var fs = require('fs');
var sourcemap = JSON.parse(fs.readFileSync('source.map', 'utf8'));
var smc = new sourceMap.SourceMapConsumer(sourcemap);
console.log(smc.originalPositionFor({
line: 424,
column: 4194
}));
node findpos.js
You should get the exact location of the error (file, line and column).
How to use Atom to find the exception source code in the index.android.bundle
All white-space is removed from the index.android.bundle and lines are concatenated to a single line. But it identifies the culprit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With