Android Runtime NoSuchMethodError

891 Views Asked by At

I recently started getting this error in certain scenarios at run time in my app...

I have already tried the following :

  1. Add proguard rules to include com.google.common.
  2. Mutlidex rules so that all the classes get packaged in main dex file
  3. I have checked the apk contents to make sure the classes are present in the dex file...
  4. Updgraded my guava android lib to latest 27.0.0-android
  5. Updated gradle plugin and gradle version to the latest

AndroidRuntime: java.lang.NoSuchMethodError: No static method checkArgument(ZLjava/lang/String;I)V in class Lcom/google/common/base/Preconditions; or its super classes (declaration of 'com.google.common.base.Preconditions' appears in /data/app/com.myapp.dev.test-Xip2SNDMljPc2_BN0p3iRg==/base.apk!classes2.dex) 03-26 13:49:19.167 14658 14751 E AndroidRuntime: at com.google.common.util.concurrent.RateLimiter.checkPermits(RateLimiter.java:424) 03-26 13:49:19.167 14658 14751 E AndroidRuntime: at com.google.common.util.concurrent.RateLimiter.tryAcquire(RateLimiter.java:341) 03-26 13:49:19.167 14658 14751 E AndroidRuntime: at com.google.common.util.concurrent.RateLimiter.tryAcquire(RateLimiter.java:325)

Not sure where to go from here now. Any ideas what else can I do ?

1

There are 1 best solutions below

1
On

Try to add below proguard configuration

-keep class com.google.common.base.**