Austyn Mahoney Austyn Mahoney - 2 years ago 137
Java Question

java.lang.VerifyError: Verifier rejected class on Lollipop when using release APK

I get this error when I install my release APK on a

device. The error does not occur when I push the same code from Android Studio, or if I run it on a

java.lang.VerifyError: Verifier rejected class$$ViewInjector due to bad method void$$ViewInjector.reset( (declaration of '$$ViewInjector' appears in /data/app/
at java.lang.Class.classForName(
at java.lang.Class.forName(
at java.lang.Class.forName(
at butterknife.ButterKnife.findInjectorForClass(
at butterknife.ButterKnife.inject(
at butterknife.ButterKnife.inject(

I inject my Toolbar and a custom NavigationDrawer in the class.

@InjectView( Toolbar mToolbar;
@InjectView( MyNavigationDrawer mNavigationDrawer;

Line 31:


Is there something that would be different with the Butterknife codegen when using
gradle assembleRelease
? I am not using ProGuard at all.

Here are my other Android build settings:

# Android SDK settings


I/art (21354): Verification error in void$$ViewInjector.inject(butterknife.ButterKnife$Finder,, java.lang.Object)
I/art (21354): void$$ViewInjector.inject(butterknife.ButterKnife$Finder,, java.lang.Object) failed to verify: register v4 has type Reference: but expected Reference: [0x0]
I/art (21354): Verification error in void$$ViewInjector.reset(
I/art (21354): void$$ViewInjector.reset( failed to verify: register v1 has type Reference: but expected Reference:
E/art (21354): Verification failed on class$$ViewInjector in /data/app/ because: Verifier rejected class$$ViewInjector due to bad method void$$ViewInjector.reset(

Answer Source

Cleaning out the build folder resolved the problem. Not sure why ART had an issue but Dalvik did not.

Running a gradle clean task was not clearing out my build folder all the way. I had to do it manually, but clean may work for some people.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download