appium / appium-espresso-driver

Espresso integration for Appium
Apache License 2.0
191 stars 75 forks source link

Crash on java.lang.NoSuchMethodError: No virtual method getDefaultEdgeSize()I in class Landroidx/customview/widget/ViewDragHelper #859

Closed arnoldashcraftIII closed 1 year ago

arnoldashcraftIII commented 1 year ago

Crash on java.lang.NoSuchMethodError: No virtual method getDefaultEdgeSize()I in class Landroidx/customview/widget/ViewDragHelper

Using Inspector and Appium server to get capabilities setup for use with Appium 2+ automated test of our Android Jetpack Compose application.

Given: Real Device: Samsung Galaxy S9 Android OS: 10 Apk not obfuscated with pro guard

Capabilities: { "platformName": "android", "appium:automationName": "espresso", "appium:driver": "compose", "appium:udid": "5a55535a4d573398", "appium:app": "/Users/ArnoldAshcraft@ADT.COM/Downloads/adt-plus-2.0.0.1421-preprod.apk", "appium:androidInstallTimeout": "180000", "appium:appPackage": "com.adt.adtplus.preprod", "appium:appActivity": "com.adt.adtplus.login.LoginActivity", "appium:espressoBuildConfig": "{\"toolsVersions\":{\"minSdk\": 28,\"compileSdk\": 33,\"targetSdk\": 33,\"kotlin\":1.7.20}\"additionalAndroidTestDependencies\": [\"androidx.lifecycle:lifecycle-common-java8:2.2.0\",\"androidx.fragment:fragment:1.5.5\",\"com.google.android.gms:play-services-base:18.2.0\",\"androidx.customview:customview:1.1.0\"]}" }

Appium server started

Inspector started

App login credentials entered via Inspector.

When:

App is logged into via Inspector.

Then:

Espresso server attempts to get screenshot and screen size, and Instrumentation process crashes with …

[debug] [EspressoDriver@0547 (0632fc91)] [Instrumentation] Process crashed while executing startEspressoServer(io.appium.espressoserver.EspressoServerRunnerTest): [debug] [EspressoDriver@0547 (0632fc91)] java.lang.NoSuchMethodError: No virtual method getDefaultEdgeSize()I in class Landroidx/customview/widget/ViewDragHelper; or its super classes (declaration of 'androidx.customview.widget.ViewDragHelper' appears in /data/app/io.appium.espressoserver.test-38Am8sH7Iy3b3TBcRPljiw==/base.apk) [debug] [EspressoDriver@0547 (0632fc91)] at androidx.drawerlayout.widget.DrawerLayout.onLayout(DrawerLayout.java:1340)

See Appium server log and ADB logcat snippet attached.

Notes: Our app does not use androidx.customview library, but I added the dependency anyway. App crashes with or without the dependency added. I asked our Dev’s to add the library to our app, as a Hail Mary attempt to resolve. Same crash exception, same location in the startup process. appiumEspressoCrashIssue.txt

arnoldashcraftIII commented 1 year ago

Upgraded Appium and Espresso server driver, blocked with new exceptions.