Search code examples
androiderror-handlingexceptionproguard

How to use "mapping.txt" file for debug and error-exception handler for Release version in Android


I want to upload errors to the user in the app to the database server, but in the Release version, because it's used with Proguard, it does not correctly represent the classes that have encountered the error, as in the example Has been laid.

Sample error message

Attempt to write to field 'java.lang.String com.employe.school.Application.Message.c.c' on a null object reference

Instead of "c.c", your actual class name will be displayed.

In general, I want to handle the App errors myself and do not use Firebase or other crash reporters.

Is there a way to solve this problem?


Solution

  • Android studio create mapping(build/outputs/mapping/release/mapping.txt) file under release folder for Release builds. You can use them to find out where the error is occured. Re-mapping is already implemented on Google Play Console and crashlytics. You just put mapping file with corresponding APK to play console and errors are shown correctly.