-
Notifications
You must be signed in to change notification settings - Fork 306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Espresso 3.5.1 crashes with IncompatibleClassChangeError on API 28 - 30 when minSdk 28 #1642
Comments
I have the same issue. Attempting to use the latest version of Jetpack Compose required me to upgrade Kotlin versions which then in turn required me to upgrade this library. I'll add more information here if I found something. |
Sorry for the trouble. I'm working on a revamp of the release toolchain which will fix this issue. As a workaround, you can try to upgrade your AGP version to the latest stable or use a min sdk < 28 |
@brettchabot as in this is fixed by AGP 7.4.2? |
I just tested with 7.4.2 and it remains broken |
Some IncompatibleClassChangeError's are fixed by using the latest AGP/D8 version, but not all. |
We too are getting the same error for espresso 3.5.0. When can we expect a fix to this? |
I should note, that this appears to be flaky. When run in isolation, the test seems to pass fine. Also, only seeing this on API 29 at the moment. |
Reposting sanitized stacktrace
|
My issue was resolved using 3.5.0-alpha04. |
Thanks for the additional reports. Many apologies for the delay here. In addition I hope to release a espresso 3.6.0-alpha01 next week which will be built with bazel + javac 11, and also will therefore not be subject to this problem. |
The patch has landed and have been backported to 8.0.33, 4.0.55 and 3.3.91 for AGP 8.0, 7.4 and 7.3 respectively. To use a specific R8 version merge the following into
|
espresso 3.6.0-alpha01 is out now |
Our team is facing new issues related to |
maybe downgrade to fix temporary that issue? What's version below 3.4? |
3.5.1 and 3.6.0 alpha04 are failing for me after a few test scenarios. 3.4.0 is working. |
Description
After upgrading to Espresso 3.5.1 view assertion (onView(...).check(matches(...))) for view into scrollView crashes on API 28-30 when used minSdk 28.
Steps to Reproduce
.check(matches(isDisplayed()))
for view in scrollView when it is not visible on the screenExpected Results
Test fails with
androidx.test.espresso.base.AssertionErrorHandler$AssertionFailedWithCauseError: '(view has effective visibility <VISIBLE> and view.getGlobalVisibleRect() to return non-empty rectangle)' doesn't match the selected view. Expected: (view has effective visibility <VISIBLE> and view.getGlobalVisibleRect() to return non-empty rectangle) Got: view.getGlobalVisibleRect() returned empty rectangle
Actual Results
Test fails with
java.lang.IncompatibleClassChangeError: Class 'org.hamcrest.StringDescription' does not implement interface 'java.lang.Iterable' in call to 'java.util.Iterator java.lang.Iterable.iterator()' (declaration of 'org.hamcrest.BaseDescription' appears in /data/app/gmk57.testespresso.test-8etyGcYaxocoQ-VLXtELkg==/base.apk) at org.hamcrest.BaseDescription.appendValueList(BaseDescription.java:76) at androidx.test.espresso.matcher.ViewMatchers.getMismatchDescriptionString(ViewMatchers.java:3) at androidx.test.espresso.matcher.ViewMatchers.assertThat(ViewMatchers.java:5) at androidx.test.espresso.assertion.ViewAssertions$MatchesViewAssertion.check(ViewAssertions.java:7) at androidx.test.espresso.ViewInteraction$SingleExecutionViewAssertion.check(ViewInteraction.java:2) at androidx.test.espresso.ViewInteraction$2.call(ViewInteraction.java:14) at androidx.test.espresso.ViewInteraction$2.call(ViewInteraction.java:1) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at android.os.Handler.handleCallback(Handler.java:873) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6669) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
AndroidX Test and Android OS Versions
Reproduced on: Android API 28-30
Not reproduced on: Android API 31-33
androidx.test.ext:junit:1.1.5
androidx.test.espresso:espresso-core:3.5.1
Gradle 7.4.2
AGP 7.3.1
buildToolsVersion "33.0.1"
compileSdk 33
minSdk 28
targetSdkVersion 33
Android Studio Dolphin | 2021.3.1 Patch 1
Link to a public git repo demonstrating the problem:
Link
Additional info
When used minSdk 27 problem not reproduced.
On espresso 3.5.0 problem reproduced.
The text was updated successfully, but these errors were encountered: