1

I tried to build and run my application with minifyEnabled and shrinkResources set to true. However, it kept on crashing and upon closer inspection, it was crashing on some of my classes and that I needed to keep these classes.

Why do I need to keep certain classes from obfuscation and not the other classes? Just need an idea of why this happens. Thank you!

Edit: The classes that cannot be minified were Serialized Objects

aaron.c
  • 13
  • 3

1 Answers1

0

From my experience, key-value object need to excluded from obfuscation

In my case, the problem is my model class and key obfuscated to a different name and string each build and make my cached data broken every time rebuild

first build my model key obfuscated to "A", second build my model key obfuscated to "B"

update: to exclude class from obfuscation check this post

aiwiguna
  • 2,852
  • 2
  • 15
  • 26
  • I checked my code and I observed that most of the classes that I needed to keep were serialized objects. Is there any way to protect these objects? – aaron.c Jul 17 '20 at 02:37
  • I already excluded the objects before. I just needed an explanation of why I needed to exclude the objects and your answer has given me some insight as to why. Thanks! – aaron.c Jul 17 '20 at 03:01
  • I am not very knowledgeable about it either, I had learned it in a hard way back then when this problem occurs in the production environment – aiwiguna Jul 17 '20 at 03:06