I am getting the dreaded VerifyError
when attempting to write and run a test using fest-android
. The error occurs when attempting to load one of my own classes:
java.lang.VerifyError: bbct/android/common/layout/test/BaseballCardDetailsLayoutTest
According to what I have read, this means that a class isn't in DEX format. But this class is in my Android Studio project and should be converted by the build process. Of course, as I said earlier, I'm trying to use fest-android
. Is there something special I need to do other than add the dependency in my build.gradle
file?
More information:
Taking a closer look at my logcat, I found the following message:
06-24 19:19:31.450 19696-19696/? W/dalvikvm﹕ Class resolved by unexpected DEX: Landroid/support/v7/app/ActionBarActivity;(0xb5734830):0xad59e000 ref [Landroid/support/v4/app/FragmentActivity;] Landroid/support/v4/app/FragmentActivity;(0xb5734830):0xad9b4000
06-24 19:19:31.450 19696-19696/? W/dalvikvm﹕ (Landroid/support/v7/app/ActionBarActivity; had used a different Landroid/support/v4/app/FragmentActivity; during pre-verification)
06-24 19:19:31.450 19696-19696/? W/dalvikvm﹕ Unable to resolve superclass of Landroid/support/v7/app/ActionBarActivity; (235)
06-24 19:19:31.450 19696-19696/? W/dalvikvm﹕ Link of class 'Landroid/support/v7/app/ActionBarActivity;' failed
06-24 19:19:31.450 19696-19696/? W/dalvikvm﹕ Unable to resolve superclass of Lbbct/android/common/activity/FragmentTestActivity; (723)
06-24 19:19:31.450 19696-19696/? W/dalvikvm﹕ Link of class 'Lbbct/android/common/activity/FragmentTestActivity;' failed
06-24 19:19:31.450 19696-19696/? E/dalvikvm﹕ Could not find class 'bbct.android.common.activity.FragmentTestActivity', referenced from method bbct.android.common.layout.test.BaseballCardDetailsLayoutTest.<init>
I was finally able to solve this problem by changing my build.gradle
file from
androidTestCompile com.squareup:fest-android:1.0.8
to
androidTestCompile ('com.squareup:fest-android:1.0.8') {
exclude group: 'com.android.support'
}