appium-espresso-driver icon indicating copy to clipboard operation
appium-espresso-driver copied to clipboard

Socket hang up trying to access Espresso server status

Open ncalaway opened this issue 4 years ago • 11 comments
trafficstars

I am unable to start a session using Espresso. Each time I do, I get socket hang ups before the Espresso server just quits. When I try to manually run adb shell am instrument -w -e debug false -e disableAnalytics true io.appium.espressoserver.test/androidx.test.runner.AndroidJUnitRunner, the result is:

INSTRUMENTATION_RESULT: shortMsg=Process crashed.
INSTRUMENTATION_CODE: 0

Here are my Appium logs.

ncalaway avatar Nov 03 '21 13:11 ncalaway

What the result of logcat when you called the adb command? I guess you need to coordinate dependencies with https://github.com/appium/appium-espresso-driver#espresso-build-config

KazuCocoa avatar Nov 03 '21 17:11 KazuCocoa

What the result of logcat when you called the adb command? I guess you need to coordinate dependencies with https://github.com/appium/appium-espresso-driver#espresso-build-config

https://gist.github.com/ncalaway/0cf588665a538277e65299387257c1a1

ncalaway avatar Nov 03 '21 17:11 ncalaway

I guess you should coordinate kotlin version or kotlin standard library version to match with the application under test by using https://github.com/appium/appium-espresso-driver#espresso-build-config

11-03 13:53:59.846  8381  8421 D TransportRuntime.JobInfoScheduler: Scheduling upload for context TransportContext(cct, HIGHEST, MSRodHRwczovL2NyYXNobHl0aWNzcmVwb3J0cy1wYS5nb29nbGVhcGlzLmNvbS92MS9maXJlbG9nL2xlZ2FjeS9iYXRjaGxvZ1xBSXphU3lCcnBTWVQ0RkZMMDlyZUhKaTZIOUZZZGVpU25VVE92Mk0=) with jobId=-1951253668 in 1000ms(Backend next call timestamp 0). Attempt 1
11-03 13:53:59.853  8381  8381 E UncaughtException: java.lang.NoSuchMethodError: No static method d0([Ljava/lang/Object;)Ljava/util/List; in class Lkotlin/collections/ArraysKt___ArraysKt; or its super classes (declaration of 'kotlin.collections.ArraysKt___ArraysKt' appears in /data/app/~~wFuEQKeTG3ClwbCjktGW1A==/io.appium.espressoserver.test-wmzqX4lCLcwiUk8ueDQJ3A==/base.apk)
11-03 13:53:59.853  8381  8381 E UncaughtException: 	at kotlin.collections.f.d0(Unknown Source:0)
11-03 13:53:59.853  8381  8381 E UncaughtException: 	at okio.q$a.d(Unknown Source:32)
11-03 13:53:59.853  8381  8381 E UncaughtException: 	at okhttp3.e0.b.<clinit>(Unknown Source:87)
11-03 13:53:59.853  8381  8381 E UncaughtException: 	at okhttp3.e0.b.t(Unknown Source:0)
11-03 13:53:59.853  8381  8381 E UncaughtException: 	at okhttp3.y.<clinit>(Unknown Source:21)
11-03 13:53:59.853  8381  8381 E UncaughtException: 	at com.echelonfit.api.b.c(Unknown Source:0)
11-03 13:53:59.853  8381  8381 E UncaughtException: 	at com.echelonfit.api.e.c(Unknown Source:0)
11-03 13:53:59.853  8381  8381 E UncaughtException: 	at com.echelonfit.api.e.b(Unknown Source:2)
11-03 13:53:59.853  8381  8381 E UncaughtException: 	at com.echelonfit.api.e.get(Unknown Source:0)
11-03 13:53:59.853  8381  8381 E UncaughtException: 	at com.echelonfit.api.i.h.b(Unknown Source:2)
11-03 13:53:59.853  8381  8381 E UncaughtException: 	at com.echelonfit.api.i.h.get(Unknown Source:0)
11-03 13:53:59.853  8381  8381 E UncaughtException: 	at com.echelonfit.authentication.domain.x.b(Unknown Source:2)
11-03 13:53:59.853  8381  8381 E UncaughtException: 	at com.echelonfit.authentication.domain.x.get(Unknown Source:0)
11-03 13:53:59.853  8381  8381 E UncaughtException: 	at com.echelonfit.authentication.domain.y.b(Unknown Source:10)
11-03 13:53:59.853  8381  8381 E UncaughtException: 	at com.echelonfit.authentication.domain.y.get(Unknown Source:0)
11-03 13:53:59.853  8381  8381 E UncaughtException: 	at e.a.a.get(Unknown Source:13)
11-03 13:53:59.853  8381  8381 E UncaughtException: 	at d.b.a.e.h.l(Unknown Source:2)

KazuCocoa avatar Nov 03 '21 18:11 KazuCocoa

I coordinated the kotlin version like you said, but I still have the same crash output in logcat.

ncalaway avatar Nov 03 '21 19:11 ncalaway

What configuration did you set? I guess kotlin version, kotlin-stdlib and kotlin-reflect or around might affect this case. You can see appium espresso driver's one in https://github.com/appium/appium-espresso-driver/blob/master/espresso-server/app/build.gradle.kts (this version is current master though).

This is my guess, but this depends on your test app's dependencies as well. If your app also specified kotlin related versions etc, the espresso config probably also should coordinate relevant dependencies as well.

KazuCocoa avatar Nov 03 '21 22:11 KazuCocoa

I specified kotlin, like so: https://github.com/appium/appium-espresso-driver#toolsversions

ncalaway avatar Nov 04 '21 15:11 ncalaway

I have the same issue while using espresso driver. has anyone suggestions how to fix it?

bronik avatar Nov 16 '21 11:11 bronik

If the app is already installed, it may need to be uninstalled. Please retry with uninstalling app and espresso server both

rajdeepv avatar Nov 16 '21 13:11 rajdeepv

Tried uninstalling application under test and Appium Settings, and forcing a rebuild of the Espresso server. Same error.

ncalaway avatar Nov 16 '21 15:11 ncalaway

@ncalaway try this solution: https://discuss.appium.io/t/appium-server-1-19-1-still-getting-lifecycleeventobserver-error-when-using-espresso-driver/32569/17

works for me

bronik avatar Nov 22 '21 12:11 bronik

@ncalaway try this solution: https://discuss.appium.io/t/appium-server-1-19-1-still-getting-lifecycleeventobserver-error-when-using-espresso-driver/32569/17

works for me

This had no discernible effect.

ncalaway avatar Nov 22 '21 15:11 ncalaway