Question
How to predict Android release build runtime crash due to Proguard obfuscation
While I am aware of how to troubleshoot Proguard related issues, verifying that no crash will occur when the app is launched is time consuming:
- Modify module's
proguard.cfg
- Build >
Clean Project
- Build >
Generate Signed App Bundle / APK...
- Wait for the entire build to finish
- Uninstall the previous APK
- Connect the phone via USB (no crash occurs on emulated device).
- Copy the release APK to the phone
- Install this new APK
- Open the app
- Boom...
FATAL EXCEPTION: main
java.lang.NoSuchFieldError: No field xxx of type yyy
When troubleshooting such an issue, I am not always sure whether my fix would work and so I end up repeating the above steps several times (as in this LinkageError).
This is, of course, very time consuming and I wish there were some messages during the build/generate itself that would tell me about those runtime errors.
It is possible that I am doing something fundamentally wrong and so I am looking for tips or advise that would help me shorten the aforementioned cycle considerably.
Is there a technique to predict Android release build runtime crash due to Proguard obfuscation?
If so, how do I accomplish this?