If I run gradle assembleDebug
from the command line, I am suddenly getting this error:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dx.util.DexEx
I started getting this error when upgrading to ButterKnife 8.5.1. None of the other answers here worked for me.
I used gradle -q :app:dependencies
to see the tree, and then looked through jar files until I found the conflict. The conflict was that butterknife's dependency on com.android.support:support-compat:25.1.0
contains a version of the accessibility class, and com.android.support:support-v4:23.1.1
also contains the class.
I solved it by changing my dependency from this:
compile 'com.jakewharton:butterknife:8.5.1'
to this:
compile('com.jakewharton:butterknife:8.5.1') {
exclude module: 'support-compat'
}
It doesn't seem to affect ButterKnife's operation so far.
Edit: There is a better solution, which was to upgrade my android support libraries to match ButterKnife's:
compile('com.android.support:appcompat-v7:25.2.0')
compile('com.android.support:design:25.2.0')
compile 'com.jakewharton:butterknife:8.5.1'