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

Unable to launch via Android Studio or Appium Inspector #810

Open
simon-gilmurray opened this issue Aug 22, 2022 · 1 comment
Open

Unable to launch via Android Studio or Appium Inspector #810

simon-gilmurray opened this issue Aug 22, 2022 · 1 comment

Comments

@simon-gilmurray
Copy link

Trying to run Espresso Driver from a test within Android Studio and getting a connection error everytime:

08-22 10:36:57.147 14941 14962 E TestRunner: org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure

I'm not sure why as I'm defining the following in my capabilities:
return new AndroidDriver(new URL("http://localhost:4723/wd/hub"), capabilities);

My Appium Server logs show the following which make it look like it's trying a totally different port, but I don't know how to change this...I've tried adding a systemPort capability within my test and setting it but that doesn't seem to help either

[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"] [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 [WD Proxy] connect ECONNREFUSED ::1:8300 [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8300/status] with no body [WD Proxy] connect ECONNREFUSED ::1:8300 [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8300/status] with no body [WD Proxy] connect ECONNREFUSED ::1:8300 [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8300/status] with no body [WD Proxy] connect ECONNREFUSED ::1:8300 [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8300/status] with no body [WD Proxy] connect ECONNREFUSED ::1:8300 [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8300/status] with no body [WD Proxy] connect ECONNREFUSED ::1:8300 [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8300/status] with no body [WD Proxy] connect ECONNREFUSED ::1:8300 [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8300/status] with no body [WD Proxy] connect ECONNREFUSED ::1:8300 [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8300/status] with no body [WD Proxy] connect ECONNREFUSED ::1:8300 [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8300/status] with no body [WD Proxy] connect ECONNREFUSED ::1:8300 [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8300/status] with no body [WD Proxy] connect ECONNREFUSED ::1:8300 [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8300/status] with no body [WD Proxy] connect ECONNREFUSED ::1:8300 [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8300/status] with no body [WD Proxy] connect ECONNREFUSED ::1:8300 [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8300/status] with no body [WD Proxy] connect ECONNREFUSED ::1:8300 [debug] [Espresso] [Instrumentation] INSTRUMENTATION_RESULT: shortMsg=Process crashed. [debug] [Espresso] INSTRUMENTATION_CODE: 0 [Espresso] Instrumentation process exited with code 0 from signal null [Espresso] Espresso server process has been unexpectedly terminated. Check the Appium server log and the logcat output for more details [debug] [Espresso] Deleting espresso session [debug] [ADB] Running '/Users/xx/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell am force-stop <package-name>' [debug] [Logcat] Stopping logcat capture [Espresso] Restoring hidden api policy to the device default configuration [debug] [ADB] Running '/Users/xx/Library/Android/sdk/platform-tools/adb -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 '/Users/xx/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 forward --remove tcp:8300' [debug] [BaseDriver] Event 'newSessionStarted' logged at 1661159786868 (10:16:26 GMT+0100 (British Summer Time)) [debug] [W3C] Encountered internal error running command: A new session could not be created. Details: Espresso server process has been unexpectedly terminated. Check the Appium server log and the logcat output for more details. Check https://github.com/appium/appium-espresso-driver#troubleshooting regarding advanced session startup troubleshooting. [debug] [W3C] Error: Espresso server process has been unexpectedly terminated. Check the Appium server log and the logcat output for more details. Check https://github.com/appium/appium-espresso-driver#troubleshooting regarding advanced session startup troubleshooting. [debug] [W3C] at Object.errorAndThrow (/usr/local/lib/node_modules/appium/node_modules/appium-support/lib/logging.js:94:35) [debug] [W3C] at condFn (/usr/local/lib/node_modules/appium/node_modules/appium-espresso-driver/lib/espresso-runner.js:283:18) [debug] [W3C] at spin (/usr/local/lib/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:138:26) [debug] [W3C] at spin (/usr/local/lib/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:148:20) [debug] [W3C] at spin (/usr/local/lib/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:148:14) [debug] [W3C] at spin (/usr/local/lib/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:148:14) [debug] [W3C] at spin (/usr/local/lib/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:148:14) [debug] [W3C] at spin (/usr/local/lib/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:148:14) [debug] [W3C] at spin (/usr/local/lib/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:148:14) [debug] [W3C] at spin (/usr/local/lib/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:148:14) [debug] [W3C] at spin (/usr/local/lib/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:148:14) [debug] [W3C] at spin (/usr/local/lib/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:148:14) [debug] [W3C] at spin (/usr/local/lib/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:148:14) [debug] [W3C] at spin (/usr/local/lib/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:148:14) [debug] [W3C] at spin (/usr/local/lib/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:148:14) [debug] [W3C] at spin (/usr/local/lib/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:148:14)

@jlipps
Copy link
Member

jlipps commented Aug 22, 2022

Instrumentation process exited with code 0 from signal null [Espresso] Espresso server process has been unexpectedly terminated. Check the Appium server log and the logcat output for more details

What did you see in logcat? why did the espresso service unexpectedly crash?

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

No branches or pull requests

3 participants