We've switched over to the Jack compiler for our Android app to take advantage of Java8 features.
However when we enabled minification (minifyEnabled true
) we saw our app crashing in seemingly random places (it was all working fine with old javac+proguard+dex).
To save time for now we decided to disable minification but now the problem we run into now is that our error reporting library reports all callstacks as unknown line numbers. I've also confirmed that we get the same broken stack trace with Log.getStackTraceString
E.g.
com.foo.android.bar: XXX
at com.foo.android.bar.quax(Unknown Source)
The only thing that seems to give us our callstack back is to enable debug (debuggable true
) but we can't submit our app like that into the store.
Any ideas?
It turns out that the Gradle plugin drives Jack as follows:
if
debug
build keep source+line informationif
non-debug
strip all source+line informationto work around this you can explicitly ask Jack to keep source/line info like so (in your gradle file):
Note: that the value of the argument MUST be a string!
You can get all valid parameters Jack supports like this:
some more info (https://code.google.com/p/android/issues/detail?id=228093)