Fatal Exception: java.lang.VerifyError or java.lang.LinkageError

First time this crash, I faced when i upgraded Kotlin version to 1.4.20.
It takes much time to fix. I investigated in code to fix and below are the finding(may be there can be other solution but below worked for me)

  1. VerifyError, i was getting due to unused argument in method signature. (may these methods are conflicting, not sure i did not test after rename methods)So i removed all unused argument by taking method name from stack trace of crash and it was working.

stack track for VerifyError error is like:
Fatal Exception: java.lang.VerifyError: Verifier rejected class e.b.b.b.b.e.k: e.b.b.b.b.e.k.K() failed to verify: e.b.b.b.b.e.k.K(): [0x5] cannot access instance field java.lang.List f.a.a.c.e.b.x from object of type Unresolved Reference: f.a.a.c.e.b.x

2. LinkageError, Somehow we write method name and it conflict with any base class method and app crashed. I was facing this issue when i was creating release apk with progurad. Due to proguard, method name was conflicting.

stack track for Linkage error is like:
Fatal Exception: java.lang.LinkageError: Method void f.a.a.c.e.b.C(int, boolean) overrides final method in class Le/v/b/d/i; (declaration of ‘f.a.a.c.e.b’ appears in base.apk!classes2.dex)

So above are my way to resolve above issue. If it is helpful for you then please clap. Thanks

Mobile App Developer