tmurakami / dexopener

An Android library that provides the ability to mock your final classes on Android devices.
Apache License 2.0
113 stars 4 forks source link

Using DataBinding causes IllegalAccessError on Emulator API 19 #8

Closed tmurakami closed 7 years ago

tmurakami commented 7 years ago

The steps to reproduce:

  1. Clone https://github.com/jaredsburrows/android-gif-example
  2. Apply the following patch in the project root

    
    diff --git a/build.gradle b/build.gradle
    index c45e8e0..ba57e81 100644
    --- a/build.gradle
    +++ b/build.gradle
    @@ -27,6 +27,7 @@ buildscript {
    repositories {
    google()
    jcenter()
    +  maven { url 'https://jitpack.io' }
    }
    
    apply from: rootProject.file("gradle/scan.gradle")
    @@ -56,7 +57,7 @@ android {
     minSdkVersion rootProject.ext.lollipop ? 21 : rootProject.ext.minSdkVersion // Optimize build speed - build with minSdk 21 if using multidex
     targetSdkVersion rootProject.ext.targetSdkVersion
     testApplicationId "burrows.apps.example.gif.test"
    -    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    +    testInstrumentationRunner "com.github.tmurakami.dexopener.DexOpenerAndroidJUnitRunner"
     resConfigs "en"                                                             // Optimize APK size - keep only english resource files for now
     vectorDrawables.useSupportLibrary = true                                    // Optimize APK size - use vector drawables
    }
    @@ -184,6 +185,7 @@ dependencies {
    debugCompile deps.leakcanaryAndroid
    releaseCompile deps.leakcanaryAndroidNoOp

Console log:

Starting 18 tests on Nexus_5_API_19(AVD) - 4.4.2

burrows.apps.example.gif.presentation.adapter.GifAdapterTest > testOnBindViewHolderOnAdapterItemClick[Nexus_5_API_19(AVD) - 4.4.2] FAILED 
        java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation
        at burrows.apps.example.gif.presentation.adapter.GifAdapter.onCreateViewHolder(GifAdapter.kt:32)

burrows.apps.example.gif.presentation.adapter.GifAdapterTest > testGetLocationShouldReturnCorrectValues[Nexus_5_API_19(AVD) - 4.4.2] FAILED 
        java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation
        at burrows.apps.example.gif.presentation.adapter.GifAdapter.onCreateViewHolder(GifAdapter.kt:32)

burrows.apps.example.gif.presentation.adapter.GifAdapterTest > testRemoveLocationObjectShouldReturnCorrectValues[Nexus_5_API_19(AVD) - 4.4.2] FAILED 
        java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation
        at burrows.apps.example.gif.presentation.adapter.GifAdapter.onCreateViewHolder(GifAdapter.kt:32)

burrows.apps.example.gif.presentation.adapter.GifAdapterTest > testGetItem[Nexus_5_API_19(AVD) - 4.4.2] FAILED 
        java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation
        at burrows.apps.example.gif.presentation.adapter.GifAdapter.onCreateViewHolder(GifAdapter.kt:32)

burrows.apps.example.gif.presentation.adapter.GifAdapterTest > testGetItemCountShouldReturnCorrectValues[Nexus_5_API_19(AVD) - 4.4.2] FAILED 
        java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation
        at burrows.apps.example.gif.presentation.adapter.GifAdapter.onCreateViewHolder(GifAdapter.kt:32)

burrows.apps.example.gif.presentation.adapter.GifAdapterTest > onViewRecycled[Nexus_5_API_19(AVD) - 4.4.2] FAILED 
        java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation
        at burrows.apps.example.gif.presentation.adapter.GifAdapter.onCreateViewHolder(GifAdapter.kt:32)

burrows.apps.example.gif.presentation.adapter.GifAdapterTest > testOnCreateViewHolder[Nexus_5_API_19(AVD) - 4.4.2] FAILED 
        java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation
        at burrows.apps.example.gif.presentation.adapter.GifAdapter.onCreateViewHolder(GifAdapter.kt:32)

burrows.apps.example.gif.presentation.adapter.GifAdapterTest > testGetItemShouldReturnCorrectValues[Nexus_5_API_19(AVD) - 4.4.2] FAILED 
        java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation
        at burrows.apps.example.gif.presentation.adapter.GifAdapter.onCreateViewHolder(GifAdapter.kt:32)

burrows.apps.example.gif.presentation.adapter.GifAdapterTest > testAddObjectShouldReturnCorrectValues[Nexus_5_API_19(AVD) - 4.4.2] FAILED 
        java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation
        at burrows.apps.example.gif.presentation.adapter.GifAdapter.onCreateViewHolder(GifAdapter.kt:32)

burrows.apps.example.gif.presentation.adapter.GifAdapterTest > testRemoveLocationShouldReturnCorrectValues[Nexus_5_API_19(AVD) - 4.4.2] FAILED 
        java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation
        at burrows.apps.example.gif.presentation.adapter.GifAdapter.onCreateViewHolder(GifAdapter.kt:32)

burrows.apps.example.gif.presentation.adapter.GifAdapterTest > testGetListCountShouldReturnCorrectValues[Nexus_5_API_19(AVD) - 4.4.2] FAILED 
        java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation
        at burrows.apps.example.gif.presentation.adapter.GifAdapter.onCreateViewHolder(GifAdapter.kt:32)

burrows.apps.example.gif.presentation.adapter.GifAdapterTest > testAddLocationObjectShouldReturnCorrectValues[Nexus_5_API_19(AVD) - 4.4.2] FAILED 
        java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation
        at burrows.apps.example.gif.presentation.adapter.GifAdapter.onCreateViewHolder(GifAdapter.kt:32)

burrows.apps.example.gif.presentation.adapter.GifAdapterTest > testAddCollectionShouldReturnCorrectValues[Nexus_5_API_19(AVD) - 4.4.2] FAILED 
        java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation
        at burrows.apps.example.gif.presentation.adapter.GifAdapter.onCreateViewHolder(GifAdapter.kt:32)

burrows.apps.example.gif.presentation.adapter.GifAdapterTest > testClearShouldClearAdapter[Nexus_5_API_19(AVD) - 4.4.2] FAILED 
        java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation
        at burrows.apps.example.gif.presentation.adapter.GifAdapter.onCreateViewHolder(GifAdapter.kt:32)

burrows.apps.example.gif.presentation.adapter.GifAdapterTest > testRemoveObjectShouldReturnCorrectValues[Nexus_5_API_19(AVD) - 4.4.2] FAILED 
        java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation
        at burrows.apps.example.gif.presentation.adapter.GifAdapter.onCreateViewHolder(GifAdapter.kt:32)

burrows.apps.example.gif.presentation.main.MainActivityTest > testTrendingThenClickOpenDialog[Nexus_5_API_19(AVD) - 4.4.2] SKIPPED 

burrows.apps.example.gif.presentation.main.MainActivityTest > testTrendingResultsThenSearchThenBackToTrending[Nexus_5_API_19(AVD) - 4.4.2] FAILED 
        java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation
        at burrows.apps.example.gif.presentation.main.MainActivity.onCreate(MainActivity.kt:26)
Tests on Nexus_5_API_19(AVD) - 4.4.2 failed: Instrumentation run failed due to 'java.lang.IllegalAccessError'

FAILURE: Build failed with an exception.