For all those who need to know, here it is. Have you ever wondered what it is we programmers do when we say we’re “fixing bugs?” Here’s a helpful guide for those who may find themselves in a “oh snap I need to fix a bug” situation.
No Logs? No Repro? 1. Check Google Play Dev console for a crash log. 2. Check crittercism/crashlytics/etc for a crash log (and sign up if you haven’t). 3. email-your users and as for logs! 4. Check stack exchange/Google for similar situations
Anatomy of a message. “Log Level” / “Process Name” : “error” caused by “reason”: “function” at “filename”:”linenumber”. This is a stacktrace! This is great!
So you have a STACKTRACE. Now what? 1. Can you READ IT? Does your function names look like “a.a.a.b” and “c.a.b.b”? This means it is obfuscated! Your build server or proguard mapping file will allow you to make this READABLE.
So You Know How To Program! Cool! 1. Find function name on or near line # from stack trace. 2. determine which input or state caused the error. 3. FIX or PREVENT the error or state.
Still Not Working? 1. Lookup the API docs for that function, these change often. 2. Validate inputs and thread /race conditions. Check for multiple instantiation, static items.
Why Is My Function CRASHING?!?!?! 1. Tried everything? Replace it! There are tons of free libraries for Android! Or Rewrite it! There is always another way!
Still Broken? 1. Find the first function name in the stack trace. 2. Type it into Google or Stack Overflow. 3. Try all Suggestions, think about similarities. 4. Repeat for every function in file.
3. Find the source file and functions which changed, this is your “improvised stacktrace.” 4. go back to the page about stack traces and use your “improvised stacktrace”