8

I have an application in production, I have got some crash report stacktraces and they are from the previous release version. I don't know if I have the ProGuard mapping file for the previous build version. I have the current one. And as far as I know that the mapping file is different for different release builds.

My question is:
How do I get the mapping file for the previous build?

DawidJ
  • 1,245
  • 12
  • 19
Shankha057
  • 1,296
  • 1
  • 20
  • 38

2 Answers2

29

If you created an app bundle (.aab) instead of an app package (.apk), you can extract the mapping file from there.

  1. Download app bundle from Google Play Console
  2. Rename file extension from .aab to .zip
  3. Extract ZIP archive
  4. Navigate to BUNDLE-METADATA/com.android.tools.build.obfuscation/proguard.map
  5. Open proguard.map with file editor, it is the mapping file.
Manuel
  • 14,274
  • 6
  • 57
  • 130
2

The mapping file is overwritten after every build so you probably lost it for good.

The best approach I can think of would be versioning your code with some VCS (Git, for example) and moving the mapping file to a location that is not being gitignored.

To move the generated proguard mapping file to a different path check this answer. You can even rename it if you like.

Henrique
  • 822
  • 8
  • 13
  • I have versioned my code in Git. But I do not save the build folder(where the mapping file is generated). So, the mapping file for the previous build is overwritten. But I want the previous one because I need to de-obfuscate the stacktrace of the previous version. I want to know how to clean-up the mess that was made earlier, not how to prevent the mess that is going to happen. – Shankha057 Jan 17 '19 at 11:13
  • AFAIK it's not possible to recover a lost mapping :( You could try checking out your old commit and build again to generate the mapping, but I think it's not guaranteed that you will end up a compatible mapping to deobfuscate your crashes. – Henrique Jan 17 '19 at 12:58
  • 1
    The mapping file should be in the App Bundle if you created one instead of an APK. In Google Play Console the mapping file is automatically extracted from that AAB file. You can try to download the bundle and extract the mapping. – Manuel Jun 01 '19 at 03:47