Android Espresso:java.lang.IncompatibleClassChangeError:类“java.lang.Class”没有实现接口“java.util.Collection”
我有一个90套Espressotesting课程的Android项目。 在我的两个工作站中,一切运行良好,但是当我在CircleCI中的docker容器中运行testing时,我对所有testing都有以下错误:
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.IncompatibleClassChangeError: Class 'java.lang.Class' does not implement interface 'java.util.Collection' in call to 'java.lang.Object[] java.util.Collection.toArray()' (declaration of 'java.util.ArrayList' appears in /system/framework/core-oj.jar) at android.support.test.espresso.base.IdlingResourceRegistry.runSynchronouslyOnMainThread(IdlingResourceRegistry.java:314)
你可以在这里看到输出:
https://circleci.com/gh/joaomneto/TitanCompanion/115
这个构build过去是有效的,但是我没有看到明显的差异来certificate这个问题是正确的。
一些时候,当我触发重build,一切正常。
这可能是由一个错误的图书馆造成的?
这是相关的configuration。
buildscript { ext.kotlin_version = '1.1.3-2' repositories { google() mavenCentral() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.0.0-beta1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.github.triplet.gradle:play-publisher:1.1.5' } } [...] dependencies { repositories { google() mavenCentral() jcenter() } implementation fileTree(include: '*.jar', dir: 'libs') implementation 'com.android.support:support-v4:25.4.0' implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" androidTestImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' androidTestImplementation 'com.android.support.test:runner:1.0.1' } [...] android { compileSdkVersion 26 buildToolsVersion "26.0.1" } defaultConfig { testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner' }
AVD正在configuration并运行如下:
sdkmanager "system-images;android-24;default;armeabi-v7a" && echo "no" | avdmanager create avd -n test -k "system-images;android-24;default;armeabi-v7a" export LD_LIBRARY_PATH=${ANDROID_HOME}/emulator/lib64:${ANDROID_HOME}/emulator/lib64/qt/lib && emulator64-arm -avd test -skin "768x1280" -noaudio -no-boot-anim -no-window -accel on -logcat *:e