How do you interpret "java.lang.NoSuchMethodError: No direct method"?

Had this on Android when the source code target version was higher than the OS version used on the device. Therefore had access to methods that didn't exist in the library bundled with the OS, hence NoSuchMethodError.


It just means that a constructor for AbstractGoogleJsonClient with a particular argument list wasn't available.

Check your super() calls for your subclass(es) of AbstractGoogleJsonClient and make sure you don't need to update the argument list to match your updated libraries.

If that's not in your source code, then there may be a library version dependency issue with Google API client library.


This issue is happened because of Proguard is applied via Proguard this class name and methods name changes that why NoSuchMethod exception is occurring.

To resolve this error please add below line into you Proguard rules.

-keep class com.google.** { *; }

Hopefully this will resolve your issue.

Tags:

Java

Android