appium / appium-espresso-driver

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

Could not proxy command to the remote server #759

Open ashirbad1986 opened 2 years ago

ashirbad1986 commented 2 years ago

Trying to lunch the aap in Appium Inspector with espresso. Caps are:

{ "platformName": "Android", "appium:deviceNme": "Nexus_10_API_29", "appium:automationName": "Espresso", "appium:udid": "emulator-5554", "appium:app": "C:\MobileAutomation\12th_MAR_V1.apk" }

KazuCocoa commented 2 years ago

Please attach the full appium log as GitHub GIST.

KazuCocoa commented 2 years ago

The logcat also helps us.

ashirbad1986 commented 2 years ago

Hi @KazuCocoa,

Please find below the raw log:

[info] [Appium] Welcome to Appium v1.22.0 [info] [Appium] Non-default server args: [info] [Appium] relaxedSecurityEnabled: true [info] [Appium] allowInsecure: { [info] [Appium] } [info] [Appium] denyInsecure: { [info] [Appium] } [info] [Appium] Appium REST http interface listener started on 0.0.0.0:4723[info] [HTTP] --> GET /wd/hub/sessions [info] [HTTP] {} [debug] [GENERIC] Calling AppiumDriver.getSessions() with args: [] [debug] [GENERIC] Responding to client with driver.getSessions() result: [] [info] [HTTP] <-- GET /wd/hub/sessions 304 4 ms - - [info] [HTTP] [info] [HTTP] --> GET /wd/hub/sessions [info] [HTTP] {} [debug] [GENERIC] Calling AppiumDriver.getSessions() with args: [] [debug] [GENERIC] Responding to client with driver.getSessions() result: [] [info] [HTTP] <-- GET /wd/hub/sessions 304 1 ms - - [info] [HTTP] [info] [HTTP] --> GET /wd/hub/sessions [info] [HTTP] {} [debug] [GENERIC] Calling AppiumDriver.getSessions() with args: [] [debug] [GENERIC] Responding to client with driver.getSessions() result: [] [info] [HTTP] <-- GET /wd/hub/sessions 304 1 ms - - [info] [HTTP] [info] [HTTP] --> GET /wd/hub/sessions [info] [HTTP] {} [debug] [GENERIC] Calling AppiumDriver.getSessions() with args: [] [debug] [GENERIC] Responding to client with driver.getSessions() result: [] [info] [HTTP] <-- GET /wd/hub/sessions 304 1 ms - - [info] [HTTP] [info] [HTTP] --> POST /wd/hub/session [info] [HTTP] {"capabilities":{"alwaysMatch":{"platformName":"Android","appium:deviceNme":"OnePlus 8 Pro - Bankai","appium:automationName":"Espresso","appium:udid":"emulator-5554","appium:app":"C:\MobileAutomation\21st_Mar_V1.apk","appium:ensureWebviewsHavePages":true,"appium:nativeWebScreenshot":true,"appium:newCommandTimeout":3600,"appium:connectHardwareKeyboard":true},"firstMatch":[{}]},"desiredCapabilities":{"platformName":"Android","appium:deviceNme":"OnePlus 8 Pro - Bankai","appium:automationName":"Espresso","appium:udid":"emulator-5554","appium:app":"C:\MobileAutomation\21st_Mar_V1.apk","appium:ensureWebviewsHavePages":true,"appium:nativeWebScreenshot":true,"appium:newCommandTimeout":3600,"appium:connectHardwareKeyboard":true}} [debug] [W3C] Calling AppiumDriver.createSession() with args: [{"platformName":"Android","appium:deviceNme":"OnePlus 8 Pro - Bankai","appium:automationName":"Espresso","appium:udid":"emulator-5554","appium:app":"C:\MobileAutomation\21st_Mar_V1.apk","appium:ensureWebviewsHavePages":true,"appium:nativeWebScreenshot":true,"appium:newCommandTimeout":3600,"appium:connectHardwareKeyboard":true},null,{"alwaysMatch":{"platformName":"Android","appium:deviceNme":"OnePlus 8 Pro - Bankai","appium:automationName":"Espresso","appium:udid":"emulator-5554","appium:app":"C:\MobileAutomation\21st_Mar_V1.apk","appium:ensureWebviewsHavePages":true,"appium:nativeWebScreenshot":true,"appium:newCommandTimeout":3600,"appium:connectHardwareKeyboard":true},"firstMatch":[{}]}] [debug] [BaseDriver] Event 'newSessionRequested' logged at 1647843239110 (11:43:59 GMT+0530 (India Standard Time)) [info] [Appium] Appium v1.22.0 creating new EspressoDriver (v1.45.3) session [info] [Appium] Applying relaxed security to 'EspressoDriver' as per server command line argument. All insecure features will be enabled unless explicitly disabled by --deny-insecure [debug] [BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided [debug] [BaseDriver] Creating session with W3C capabilities: { [debug] [BaseDriver] "alwaysMatch": { [debug] [BaseDriver] "platformName": "Android", [debug] [BaseDriver] "appium:deviceNme": "OnePlus 8 Pro - Bankai", [debug] [BaseDriver] "appium:automationName": "Espresso", [debug] [BaseDriver] "appium:udid": "emulator-5554", [debug] [BaseDriver] "appium:app": "C:\MobileAutomation\21st_Mar_V1.apk", [debug] [BaseDriver] "appium:ensureWebviewsHavePages": true, [debug] [BaseDriver] "appium:nativeWebScreenshot": true, [debug] [BaseDriver] "appium:newCommandTimeout": 3600, [debug] [BaseDriver] "appium:connectHardwareKeyboard": true [debug] [BaseDriver] }, [debug] [BaseDriver] "firstMatch": [ [debug] [BaseDriver] {} [debug] [BaseDriver] ] [debug] [BaseDriver] } [warn] [BaseDriver] The following capabilities were provided, but are not recognized by Appium: [warn] [BaseDriver] deviceNme [warn] [BaseDriver] connectHardwareKeyboard [info] [BaseDriver] Session created with session id: 7d0d219f-1af5-45aa-b456-26c49c8c8a59[info] [Espresso] EspressoDriver version: 1.45.3 [info] [ADB] Found 4 'build-tools' folders under 'C:\Users\prust\AppData\Local\Android\Sdk' (newest first): [info] [ADB] C:/Users/prust/AppData/Local/Android/Sdk/build-tools/33.0.0-rc1 [info] [ADB] C:/Users/prust/AppData/Local/Android/Sdk/build-tools/32.1.0-rc1 [info] [ADB] C:/Users/prust/AppData/Local/Android/Sdk/build-tools/32.0.0 [info] [ADB] C:/Users/prust/AppData/Local/Android/Sdk/build-tools/29.0.2 [info] [ADB] Using 'adb.exe' from 'C:\Users\prust\AppData\Local\Android\Sdk\platform-tools\adb.exe' [debug] [ADB] Running 'C:\Users\prust\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 start-server'[info] [AndroidDriver] Retrieving device list [debug] [ADB] Trying to find a connected android device [debug] [ADB] Getting connected devices[debug] [ADB] Connected devices: [{"udid":"emulator-5554","state":"device"}] [info] [AndroidDriver] Using device: emulator-5554 [info] [ADB] Using 'adb.exe' from 'C:\Users\prust\AppData\Local\Android\Sdk\platform-tools\adb.exe' [debug] [ADB] Running 'C:\Users\prust\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 start-server' [debug] [ADB] Setting device id to emulator-5554 [debug] [ADB] Running 'C:\Users\prust\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell getprop ro.build.version.sdk' [debug] [ADB] Current device property 'ro.build.version.sdk': 29 [info] [ADB] Getting device platform version [debug] [ADB] Running 'C:\Users\prust\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell getprop ro.build.version.release' [debug] [ADB] Current device property 'ro.build.version.release': 10 [debug] [ADB] Device API level: 29 [warn] [Espresso] Relaxing hidden api policy [debug] [ADB] Running 'C:\Users\prust\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell 'settings put global hidden_api_policy_pre_p_apps 1;settings put global hidden_api_policy_p_apps 1;settings put global hidden_api_policy 1''[debug] [AndroidDriver] Parsing package and activity from app manifest [info] [ADB] Package name: 'com.datafinch' [info] [ADB] Main activity name: 'com.datafinch.MainActivity' [debug] [AndroidDriver] Parsed package and activity are: com.datafinch/com.datafinch.MainActivity [debug] [ADB] Running 'C:\Users\prust\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 wait-for-device' [debug] [ADB] Running 'C:\Users\prust\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell echo ping'[debug] [AndroidDriver] Pushing settings apk to device... [debug] [ADB] Getting install status for io.appium.settings [debug] [ADB] Running 'C:\Users\prust\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.settings' [debug] [ADB] 'io.appium.settings' is not installed [debug] [ADB] App 'C:\Users\prust\AppData\Local\Programs\Appium Server GUI\resources\app\node_modules\appium\node_modules\io.appium.settings\apks\settings_apk-debug.apk' is not installed [debug] [ADB] Installing 'C:\Users\prust\AppData\Local\Programs\Appium Server GUI\resources\app\node_modules\appium\node_modules\io.appium.settings\apks\settings_apk-debug.apk' [debug] [ADB] Running 'C:\Users\prust\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 help' [debug] [ADB] Running 'C:\Users\prust\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 features'[info] [ADB] The application at 'C:\Users\prust\AppData\Local\Programs\Appium Server GUI\resources\app\node_modules\appium\node_modules\io.appium.settings\apks\settings_apk-debug.apk' will not be cached, because the device under test has confirmed the support of streamed installs [debug] [ADB] Running 'C:\Users\prust\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 install -g 'C:\Users\prust\AppData\Local\Programs\Appium Server GUI\resources\app\node_modules\appium\node_modules\io.appium.settings\apks\settings_apk-debug.apk'' [info] [ADB] The installation of 'settings_apk-debug.apk' took 226ms [debug] [ADB] Install command stdout: Performing Streamed Install [debug] [ADB] Success [debug] [ADB] Getting IDs of all 'io.appium.settings' processes [debug] [ADB] Running 'C:\Users\prust\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell 'pgrep --help; echo $?''[debug] [ADB] Running 'C:\Users\prust\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pgrep -f ([[:blank:]]|\^)io.appium.settings([[:blank:]]|\$)' [debug] [ADB] Getting IDs of all 'io.appium.settings' processes [debug] [ADB] Running 'C:\Users\prust\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pgrep -f ([[:blank:]]|\^)io.appium.settings([[:blank:]]|\$)'[debug] [ADB] Starting Appium Settings app [debug] [ADB] Running 'C:\Users\prust\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am start -n io.appium.settings/.Settings -a android.intent.action.MAIN -c android.intent.category.LAUNCHER' [debug] [ADB] Getting IDs of all 'io.appium.settings' processes [debug] [ADB] Running 'C:\Users\prust\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pgrep -f ([[:blank:]]|\^)io.appium.settings([[:blank:]]|\$)'[debug] [ADB] Getting IDs of all 'io.appium.settings' processes [debug] [ADB] Running 'C:\Users\prust\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pgrep -f ([[:blank:]]|\^)io.appium.settings([[:blank:]]|\$)'[debug] [Logcat] Starting logs capture with command: C:\Users\prust\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 logcat -v threadtime [debug] [ADB] Running 'C:\Users\prust\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell settings get global animator_duration_scale' [debug] [ADB] Running 'C:\Users\prust\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell settings get global transition_animation_scale'[debug] [ADB] Running 'C:\Users\prust\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell settings get global window_animation_scale'[debug] [ADB] Running 'C:\Users\prust\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am broadcast -a io.appium.settings.animation -n io.appium.settings/.receivers.AnimationSettingReceiver --es setstatus disable' [debug] [Espresso] Forwarding Espresso Server port 6791 to 8300 [debug] [ADB] Forwarding system: 8300 to device: 6791 [debug] [ADB] Running 'C:\Users\prust\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 forward tcp:8300 tcp:6791' [debug] [ADB] Running 'C:\Users\prust\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys window'[info] [AndroidDriver] Screen already unlocked, doing nothing [debug] [ADB] Checking app cert for C:\MobileAutomation\21st_Mar_V1.apk[info] [ADB] Using 'apksigner.jar' from 'C:\Users\prust\AppData\Local\Android\Sdk\build-tools\33.0.0-rc1\lib\apksigner.jar' [debug] [ADB] Starting apksigner: 'C:\Program Files\Java\jdk-11.0.11\bin\java.exe' -Xmx1024M -Xss1m -jar C:\Users\prust\AppData\Local\Android\Sdk\build-tools\33.0.0-rc1\lib\apksigner.jar verify --print-certs C:\MobileAutomation\21st_Mar_V1.apk[debug] [ADB] apksigner stdout: Signer #1 certificate DN: CN=Android Debug, OU=Android, O=Unknown, L=Unknown, ST=Unknown, C=US [debug] [ADB] Signer #1 certificate SHA-256 digest: fac61745dc0903786fb9ede62a962b399f7348f0bb6f899b8332667591033b9c [debug] [ADB] Signer #1 certificate SHA-1 digest: 5e8f16062ea3cd2c4a0d547876baa6f38cabf625 [debug] [ADB] Signer #1 certificate MD5 digest: 20f46148b72d8e5e5ca23d37a4f41490 [debug] [ADB] [info] [ADB] 'C:\MobileAutomation\21st_Mar_V1.apk' is signed with a non-default certificate[debug] [ADB] C:\MobileAutomation\21st_Mar_V1.apk' is already zip-aligned. Doing nothing [debug] [ADB] Signing 'C:\MobileAutomation\21st_Mar_V1.apk' with default cert [debug] [ADB] Starting apksigner: 'C:\Program Files\Java\jdk-11.0.11\bin\java.exe' -Xmx1024M -Xss1m -jar C:\Users\prust\AppData\Local\Android\Sdk\build-tools\33.0.0-rc1\lib\apksigner.jar sign --key 'C:\Users\prust\AppData\Local\Programs\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-adb\keys\testkey.pk8' --cert 'C:\Users\prust\AppData\Local\Programs\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-adb\keys\testkey.x509.pem' C:\MobileAutomation\21st_Mar_V1.apk[debug] [ADB] Getting install status for com.datafinch [debug] [ADB] Running 'C:\Users\prust\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package com.datafinch' [debug] [ADB] 'com.datafinch' is not installed [debug] [ADB] App 'C:\MobileAutomation\21st_Mar_V1.apk' is not installed [debug] [ADB] Installing 'C:\MobileAutomation\21st_Mar_V1.apk' [info] [ADB] The application at 'C:\MobileAutomation\21st_Mar_V1.apk' will not be cached, because the device under test has confirmed the support of streamed installs [debug] [ADB] Running 'C:\Users\prust\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 install C:\MobileAutomation\21st_Mar_V1.apk'[info] [ADB] The installation of '21st_Mar_V1.apk' took 860ms [debug] [ADB] Install command stdout: Serving... [debug] [ADB] Performing Incremental Install [debug] [ADB] Unknown command: install-incremental [debug] [ADB] Performing Streamed Install [debug] [ADB] Success [debug] [ADB] Running 'C:\Users\prust\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell "[ -e '/data/local/tmp/espresso.apppackage' ] && echo PASS"'[debug] [Espresso] The previous target application package is unknown [info] [Espresso] Forcing Espresso server rebuild because of changed application package [info] [Espresso] Building espresso server in 'C:\Users\prust\AppData\Local\Temp\espresso-server-emulator-5554' [debug] [Espresso] The build folder root could be customized by changing the 'tmpDir' capability [debug] [Espresso] Copying espresso server template from ('C:\Users\prust\AppData\Local\Programs\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-espresso-driver\espresso-server' to 'C:\Users\prust\AppData\Local\Temp\espresso-server-emulator-5554')[debug] [Espresso] Bulding espresso server [debug] [Espresso] Beginning build with command 'gradlew.bat -PappiumTargetPackage=com.datafinch app:assembleAndroidTest' in directory 'C:\Users\prust\AppData\Local\Temp\espresso-server-emulator-5554' [debug] [Espresso] Output from Gradle will not be logged. To change this, use 'showGradleLog' desired capability[debug] [Espresso] Copying built apk from 'C:\Users\prust\AppData\Local\Temp\espresso-server-emulator-5554\app\build\outputs\apk\androidTest\debug\app-debug-androidTest.apk' to 'C:\Users\prust\AppData\Local\Temp\io.appium.espressoserver.test_1.45.3_com.datafinch_emulator-5554.apk' [debug] [ADB] Checking app cert for C:\Users\prust\AppData\Local\Temp\io.appium.espressoserver.test_1.45.3_com.datafinch_emulator-5554.apk [debug] [ADB] Starting apksigner: 'C:\Program Files\Java\jdk-11.0.11\bin\java.exe' -Xmx1024M -Xss1m -jar C:\Users\prust\AppData\Local\Android\Sdk\build-tools\33.0.0-rc1\lib\apksigner.jar verify --print-certs C:\Users\prust\AppData\Local\Temp\io.appium.espressoserver.test_1.45.3_com.datafinch_emulator-5554.apk[debug] [ADB] apksigner stdout: Signer #1 certificate DN: C=US, O=Android, CN=Android Debug [debug] [ADB] Signer #1 certificate SHA-256 digest: c1383b2734e1a9012ad206397811e317d910f5b52f8dceec19d2ae6f33bc24ee [debug] [ADB] Signer #1 certificate SHA-1 digest: 11e6af51b07ea7ca32891dccbae004cc59481201 [debug] [ADB] Signer #1 certificate MD5 digest: 621fa1143fd80b9b269717bf150e1e2b [debug] [ADB] [info] [ADB] 'C:\Users\prust\AppData\Local\Temp\io.appium.espressoserver.test_1.45.3_com.datafinch_emulator-5554.apk' is signed with a non-default certificate [debug] [ADB] C:\Users\prust\AppData\Local\Temp\io.appium.espressoserver.test_1.45.3_com.datafinch_emulator-5554.apk' is already zip-aligned. Doing nothing [debug] [ADB] Signing 'C:\Users\prust\AppData\Local\Temp\io.appium.espressoserver.test_1.45.3_com.datafinch_emulator-5554.apk' with default cert [debug] [ADB] Starting apksigner: 'C:\Program Files\Java\jdk-11.0.11\bin\java.exe' -Xmx1024M -Xss1m -jar C:\Users\prust\AppData\Local\Android\Sdk\build-tools\33.0.0-rc1\lib\apksigner.jar sign --key 'C:\Users\prust\AppData\Local\Programs\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-adb\keys\testkey.pk8' --cert 'C:\Users\prust\AppData\Local\Programs\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-adb\keys\testkey.x509.pem' C:\Users\prust\AppData\Local\Temp\io.appium.espressoserver.test_1.45.3_com.datafinch_emulator-5554.apk[debug] [ADB] Uninstalling io.appium.espressoserver.test [debug] [ADB] Getting install status for io.appium.espressoserver.test [debug] [ADB] Running 'C:\Users\prust\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.espressoserver.test'[debug] [ADB] 'io.appium.espressoserver.test' is not installed [info] [ADB] io.appium.espressoserver.test was not uninstalled, because it was not present on the device [debug] [ADB] Getting install status for io.appium.espressoserver.test [debug] [ADB] Running 'C:\Users\prust\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.espressoserver.test' [debug] [ADB] 'io.appium.espressoserver.test' is not installed [debug] [ADB] App 'C:\Users\prust\AppData\Local\Temp\io.appium.espressoserver.test_1.45.3_com.datafinch_emulator-5554.apk' is not installed [info] [Espresso] Installing Espresso Test Server apk from the target device (path: 'C:\Users\prust\AppData\Local\Temp\io.appium.espressoserver.test_1.45.3_com.datafinch_emulator-5554.apk') [info] [ADB] The application at 'C:\Users\prust\AppData\Local\Temp\io.appium.espressoserver.test_1.45.3_com.datafinch_emulator-5554.apk' will not be cached, because the device under test has confirmed the support of streamed installs [debug] [ADB] Running 'C:\Users\prust\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 install C:\Users\prust\AppData\Local\Temp\io.appium.espressoserver.test_1.45.3_com.datafinch_emulator-5554.apk'[info] [ADB] The installation of 'io.appium.espressoserver.test_1.45.3_com.datafinch_emulator-5554.apk' took 182ms [debug] [ADB] Install command stdout: Serving... [debug] [ADB] Performing Incremental Install [debug] [ADB] Unknown command: install-incremental [debug] [ADB] Performing Streamed Install [debug] [ADB] Success [info] [Espresso] Installed Espresso Test Server apk 'C:\Users\prust\AppData\Local\Temp\io.appium.espressoserver.test_1.45.3_com.datafinch_emulator-5554.apk' (pkg: 'io.appium.espressoserver.test') [info] [ADB] Adding packages ["io.appium.settings","io.appium.espressoserver.test"] to Doze whitelist [debug] [ADB] Got the following command chunks to execute: [["dumpsys","deviceidle","whitelist","+io.appium.settings",";","dumpsys","deviceidle","whitelist","+io.appium.espressoserver.test",";"]] [debug] [ADB] Running 'C:\Users\prust\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys deviceidle whitelist +io.appium.settings ; dumpsys deviceidle whitelist +io.appium.espressoserver.test ;' [debug] [Espresso] Performing cleanup of automation leftovers [debug] [Espresso] No obsolete sessions have been detected (socket hang up) [info] [Espresso] Starting Espresso Server v1.45.3 with cmd: adb shell am instrument -w -e debug false -e disableAnalytics true io.appium.espressoserver.test/androidx.test.runner.AndroidJUnitRunner [debug] [ADB] Creating ADB subprocess with args: ["-P",5037,"-s","emulator-5554","shell","am","instrument","-w","-e","debug",false,"-e","disableAnalytics",true,"io.appium.espressoserver.test/androidx.test.runner.AndroidJUnitRunner"] [info] [Espresso] Waiting up to 45000ms for Espresso server to be online [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8300/status] with no body [info] [WD Proxy] socket hang up[debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8300/status] with no body [info] [WD Proxy] socket hang up[debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8300/status] with no body[info] [WD Proxy] socket hang up[debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8300/status] with no body [info] [WD Proxy] socket hang up[debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8300/status] with no body [info] [WD Proxy] socket hang up [debug] [Espresso] [Instrumentation] io.appium.espressoserver.EspressoServerRunnerTest:[debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8300/status] with no body [debug] [WD Proxy] Got response with status 200: {"id":"7f6c2b7d-7711-43b5-8daa-f5a49df80c3a","sessionId":null,"value":null} [info] [Espresso] Espresso server is online. The initialization process took 2663ms [info] [Espresso] Starting the session [debug] [WD Proxy] Matched '/session' to command name 'createSession' [debug] [WD Proxy] Proxying [POST /session] to [POST http://localhost:8300/session] with body: {"capabilities":{"firstMatch":[{"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"Android","deviceNme":"OnePlus 8 Pro - Bankai","automationName":"Espresso","udid":"emulator-5554","app":"C:\MobileAutomation\21st_Mar_V1.apk","ensureWebviewsHavePages":true,"nativeWebScreenshot":true,"newCommandTimeout":3600,"connectHardwareKeyboard":true},"platformName":"Android","deviceNme":"OnePlus 8 Pro - Bankai","automationName":"Espresso","udid":"emulator-5554","app":"C:\MobileAutomation\21st_Mar_V1.apk","ensureWebviewsHavePages":true,"nativeWebScreenshot":true,"newCommandTimeout":3600,"connectHardwareKeyboard":true,"deviceName":"emulator-5554","deviceUDID":"emulator-5554","appPackage":"com.datafinch","appWaitPackage":"com.datafinch","appActivity":"com.datafinch.MainActivity","appWaitActivity":"com.datafinch.MainActivity"}],"alwaysMatch":{}}} [debug] [Espresso] [Instrumentation] Process crashed while executing startEspressoServer(io.appium.espressoserver.EspressoServerRunnerTest): [debug] [Espresso] java.lang.NoSuchMethodError: No static method lifecycleEventObserver(Ljava/lang/Object;)Landroidx/lifecycle/LifecycleEventObserver; in class Landroidx/lifecycle/Lifecycling; or its super classes (declaration of 'androidx.lifecycle.Lifecycling' appears in /data/app/io.appium.espressoserver.test-rqBo-nEteUMe3gA2ArnJiQ==/base.apk) [debug] [Espresso] at androidx.lifecycle.LifecycleRegistry$ObserverWithState.(LifecycleRegistry.java:347) [debug] [Espresso] at androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.java:174) [debug] [Espresso] at androidx.activity.ComponentActivity.(ComponentActivity.java:228) [debug] [Espresso] at androidx.fragment.app.FragmentActivity.(FragmentActivity.java:103) [debug] [Espresso] at androidx.appcompat.app.AppCompatActivity.(AppCompatActivity.java:94) [debug] [Espresso] at com.facebook.react.ReactActivity.(ReactActivity.java:26) [debug] [Espresso] at com.datafinch.MainActivity.(MainActivity.java:5) [debug] [Espresso] at java.lang.Class.newInstance(Native Method) [debug] [Espresso] at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95) [debug] [Espresso] at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:45) [debug] [Espresso] at android.app.Instrumentation.newActivity(Instrumentation.java:1243) [debug] [Espresso] at androidx.test.runner.MonitoringInstrumentation.newActivity(MonitoringInstrumentation.java:798) [debug] [Espresso] at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3182) [debug] [Espresso] at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409) [debug] [Espresso] at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) [debug] [Espresso] at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) [debug] [Espresso] at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) [debug] [Espresso] at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016) [debug] [Espresso] at android.os.Handler.dispatchMessage(Handler.java:107) [debug] [Espresso] at android.os.Looper.loop(Looper.java:214) [debug] [Espresso] at android.app.ActivityThread.main(ActivityThread.java:7356) [debug] [Espresso] at java.lang.reflect.Method.invoke(Native Method) [debug] [Espresso] at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) [debug] [Espresso] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)[info] [WD Proxy] socket hang up [debug] [Espresso] Deleting espresso session [debug] [ADB] Running 'C:\Users\prust\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am broadcast -a io.appium.settings.animation -n io.appium.settings/.receivers.AnimationSettingReceiver --es setstatus enable' [debug] [Espresso] [Instrumentation] INSTRUMENTATION_RESULT: shortMsg=Process crashed. [debug] [Espresso] INSTRUMENTATION_CODE: 0 [info] [Espresso] Instrumentation process exited with code 0 from signal null [debug] [ADB] Running 'C:\Users\prust\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am force-stop com.datafinch'[debug] [Logcat] Stopping logcat capture [info] [Espresso] Restoring hidden api policy to the device default configuration [debug] [ADB] Running 'C:\Users\prust\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell 'settings delete global hidden_api_policy_pre_p_apps;settings delete global hidden_api_policy_p_apps;settings delete global hidden_api_policy'' [debug] [ADB] Removing forwarded port socket connection: 8300 [debug] [ADB] Running 'C:\Users\prust\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 forward --remove tcp:8300'[debug] [BaseDriver] Event 'newSessionStarted' logged at 1647843269294 (11:44:29 GMT+0530 (India Standard Time)) [debug] [W3C] Encountered internal error running command: A new session could not be created. Details: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: socket hang up. Check https://github.com/appium/appium-espresso-driver#troubleshooting regarding advanced session startup troubleshooting. [debug] [W3C] UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: socket hang up. Check https://github.com/appium/appium-espresso-driver#troubleshooting regarding advanced session startup troubleshooting. [debug] [W3C] at EspressoProxy.command (C:\Users\prust\AppData\Local\Programs\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\jsonwp-proxy\proxy.js:274:13) [debug] [W3C] at processTicksAndRejections (internal/process/task_queues.js:85:5) [info] [HTTP] <-- POST /wd/hub/session 500 30188 ms - 972 [info] [HTTP] 

KazuCocoa commented 2 years ago

Probably you need the below dependency

[debug] [Espresso] [Instrumentation] Process crashed while executing startEspressoServer(io.appium.espressoserver.EspressoServerRunnerTest):
[debug] [Espresso] java.lang.NoSuchMethodError: No static method lifecycleEventObserver(Ljava/lang/Object;)Landroidx/lifecycle/LifecycleEventObserver; in class Landroidx/lifecycle/Lifecycling; or its super classes (declaration of 'androidx.lifecycle.Lifecycling' appears in /data/app/io.appium.espressoserver.test-rqBo-nEteUMe3gA2ArnJiQ==/base.apk)

https://github.com/appium/appium-espresso-driver/issues/639 might help.

KimEklund13 commented 2 years ago

I ran into the same issue and resolved it using the desired capability espressoBuildConfig

"appium:espressoBuildConfig": "{ \"additionalAndroidTestDependencies\": \"androidx.lifecycle:lifecycle-common:2.2.0\"}"

ashirbad1986 commented 2 years ago

I ran into the same issue and resolved it using the desired capability espressoBuildConfig

"appium:espressoBuildConfig": "{ "additionalAndroidTestDependencies": "androidx.lifecycle:lifecycle-common:2.2.0"}"

Thanks Kim, I will try and update here