Skip to content
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 server process unexpectedly terminated #839

Open
Stephane-Tostivin opened this issue Dec 7, 2022 · 3 comments
Open

Espresso server process unexpectedly terminated #839

Stephane-Tostivin opened this issue Dec 7, 2022 · 3 comments

Comments

@Stephane-Tostivin
Copy link

Environment:

  • Appium 2.0.0-beta.46
  • Espresso driver espresso@2.13.8
  • Java 11

Appium capabilities:

  "platformName": "Android",
  "appium:platformVersion": "11.0",
  "appium:automationName": "Espresso",
  "appium:deviceName": "emulator-5554",
  "appium:app": "xxx.apk,
  "appium:espressoBuildConfig": "xxx/src/test/resources/espressoBuildConfig.json",
  "appium:showGradleLog": true,
  "appium:noReset": false,
  "appium:fullReset": false,
  "appium:forceEspressoRebuild": true
}

espressoBuildConfig:

{
  "toolsVersions": {
    "gradle": "7.5.1",
    "androidGradlePlugin": "7.2.2",
    "kotlin": "1.7.0",
    "buildTools": "32.0.0",
    "compileSdk": 32,
    "minSdk": 26,
    "targetSdk": 32,
    "composeVersion": "1.2.1"
  },
  "additionalAppDependencies": [
    "androidx.appcompat:appcompat:1.2.0",
    [...]
    "androidx.annotation:annotation:1.3.0"
  ],
  "additionalAndroidTestDependencies": [
    "androidx.test:runner:1.4.0",
    "androidx.compose.ui:ui-test-junit4:1.2.1",
    "androidx.compose.ui:ui-test-manifest:1.2.1",
    "androidx.test.ext:junit:1.1.3",
    "org.mockito.kotlin:mockito-kotlin:4.0.0",
    "org.mockito:mockito-core:4.9.0",
    "org.mockito:mockito-inline:4.9.0"
  ]
}

Description:
When the espresso driver start it crashes when instantiating the instrumented app

[EspressoDriver@bcc9 (08363154)] Waiting up to 10000ms for Espresso server to be online
[debug] [EspressoDriver@bcc9 (08363154)] Matched '/status' to command name 'getStatus'
[debug] [EspressoDriver@bcc9 (08363154)] Proxying [GET /status] to [GET http://127.0.0.1:8300/status] with no body
[EspressoDriver@bcc9 (08363154)] socket hang up
[debug] [EspressoDriver@bcc9 (08363154)] Matched '/status' to command name 'getStatus'
[debug] [EspressoDriver@bcc9 (08363154)] Proxying [GET /status] to [GET http://127.0.0.1:8300/status] with no body
[EspressoDriver@bcc9 (08363154)] socket hang up
[debug] [EspressoDriver@bcc9 (08363154)] [Instrumentation] INSTRUMENTATION_RESULT: shortMsg=Process crashed.
[debug] [EspressoDriver@bcc9 (08363154)] INSTRUMENTATION_CODE: 0

Logcat:

    Process: com.praxedo.pm3.prerelease, PID: 9693
    java.lang.RuntimeException: Unable to instantiate instrumentation ComponentInfo{io.appium.espressoserver.test/androidx.test.runner.AndroidJUnitRunner}: java.lang.ClassNotFoundException: Didn't find class "androidx.test.runner.AndroidJUnitRunner" on path: DexPathList[[zip file "/system/framework/android.test.runner.jar", zip file "/system/framework/android.test.mock.jar", zip file "/system/framework/android.test.base.jar", zip file "/data/app/~~kt06wzWTpuc_1s6Jv0gUaw==/io.appium.espressoserver.test-3L_Qos4xGbuUCQsjaSsYKg==/base.apk", zip file "/data/app/~~P0LRx0uRi4whV04lZC4FcQ==/com.praxedo.pm3.prerelease-zN1-dx3u9i8CA6UhsqV2-w==/base.apk"],nativeLibraryDirectories=[/system/lib64, /system_ext/lib64]]
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6647)
        at android.app.ActivityThread.access$1300(ActivityThread.java:237)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:223)
        at android.app.ActivityThread.main(ActivityThread.java:7656)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.test.runner.AndroidJUnitRunner" on path: DexPathList[[zip file "/system/framework/android.test.runner.jar", zip file "/system/framework/android.test.mock.jar", zip file "/system/framework/android.test.base.jar", zip file "/data/app/~~kt06wzWTpuc_1s6Jv0gUaw==/io.appium.espressoserver.test-3L_Qos4xGbuUCQsjaSsYKg==/base.apk", zip file "/data/app/~~P0LRx0uRi4whV04lZC4FcQ==/com.praxedo.pm3.prerelease-zN1-dx3u9i8CA6UhsqV2-w==/base.apk"],nativeLibraryDirectories=[/system/lib64, /system_ext/lib64]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6643)
        at android.app.ActivityThread.access$1300(ActivityThread.java:237) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913) 
        at android.os.Handler.dispatchMessage(Handler.java:106) 
        at android.os.Looper.loop(Looper.java:223) 
        at android.app.ActivityThread.main(ActivityThread.java:7656) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) 
2022-12-07 23:52:22.382 9693-9693/? I/Process: Sending signal. PID: 9693 SIG: 9

It seems the espresso server can't find the testrunner from the androidx package, but I don't see why and if is something is missing or incorrect in my configuration.

@KazuCocoa
Copy link
Member

KazuCocoa commented Dec 8, 2022

Not my env, but i saw similar behavior before. Then, the local gradle cache broke the build package. Ran ./gradlew clean and reboot the machine fixed at that time, but not entirely clear what caused such missing androidx's own package. It is not in Appium's package stuff, so I assume something androidx's dependencies stuff though...

@Stephane-Tostivin
Copy link
Author

Stephane-Tostivin commented Dec 8, 2022

Hello @KazuCocoa , tried what you suggested: ./gradlew clean and reboot, with no effect. I've doubled/tripled checked the dependencies declared in buildEspressConfig and tested changes without positive result as well.
Could it be something incorrect or missing in the app under test?

@KazuCocoa
Copy link
Member

hm, then i have no idea right now, unfortunately...

Could it be something incorrect or missing in the app under test?

The package is in general androidx package, so I assume missing something should not be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants