0

I have a jar library. I used Java Class File Editor (CE) to modify one class in this library. In this class, I changed a variable from private static final to public static. Afterwards, I put the newly modified class file into same jar library using WinRAR.

However, running the app on Android produces a NoClassDefFoundError.

How do I resolve the NoClassDefFoundError?

Please help.

jenzz
  • 7,239
  • 6
  • 49
  • 69
jas7
  • 2,893
  • 6
  • 23
  • 36

3 Answers3

1

One possibility is that WinRAR has created a file that is no longer JAR compatible. I'd recommend not using WinRAR. Use the jar command to unpack that JAR file into a directory tree, make the change(s), and repack it again using jar.

Another possibility is that your change has triggered a code verification problem or similar. Show us the complete error message and stacktrace for the exception?

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216
0

I'm not sure if this is related or if it's entirely possible that changing the contents of a class file could've affected this, but maybe you should just try doing Project -> Clean in Eclipse. Also, do try including the jar file in the /libs folder if you haven't already.

Furthermore, confirm that your Jar file is compressed properly when you recreated it.

Kgrover
  • 2,106
  • 2
  • 36
  • 54
0

I think the problem is caused by RSA encryption.

jas7
  • 2,893
  • 6
  • 23
  • 36