2

My code works fine with debug build varient but whent i try with release build it givs me an error java.lang.NoSuchFieldException: for some enum value

String str = mGson.toJson(obj));

I tried so many answers but it did not work i have enum in my progurad rules file

 -keepclassmembers enum * {
 public static **[] values();
 public static ** valueOf(java.lang.String);
 }
Kapil Parmar
  • 881
  • 8
  • 19
  • try this https://stackoverflow.com/a/33201546/413127 add `;` – Blundell Aug 03 '19 at 21:11
  • its not working for me – Kapil Parmar Aug 03 '19 at 21:21
  • You could sanity check that thats the problem, i.e. write a bit of code in your app that Log's out the enum name. That way it should be kept by proguard anyway. Once you prove that works, you know the problem is your proguard config. – Blundell Aug 03 '19 at 21:23

0 Answers0