Appium session not getting created with espresso driver

Failed to create session. A new session could not be created. Details: Appium Settings app is not running after 5000ms. Check GitHub - appium/appium-espresso-driver: Espresso integration for Appium regarding advanced session startup troubleshooting.

[dd5d39c0][AppiumDriver@ef05] Encountered internal error running command: A new session could not be created. Details: Appium Settings app is not running after 5000ms. Check GitHub - appium/appium-espresso-driver: Espresso integration for Appium regarding advanced session startup troubleshooting.
Error: Appium Settings app is not running after 5000ms
at SettingsApp.requireRunning (/Users/rakeshkarkare/node_modules/appium-espresso-driver/node_modules/io.appium.settings/lib/client.js:97:13)
at EspressoDriver.pushSettingsApp (/Users/rakeshkarkare/node_modules/appium-espresso-driver/node_modules/appium-android-driver/lib/commands/device/utils.js:252:5)
at EspressoDriver.initDevice (/Users/rakeshkarkare/node_modules/appium-espresso-driver/node_modules/appium-android-driver/lib/commands/device/common.js:228:5)
at EspressoDriver.startEspressoSession (/Users/rakeshkarkare/node_modules/appium-espresso-driver/lib/driver.ts:410:5)
at EspressoDriver.createSession (/Users/rakeshkarkare/node_modules/appium-espresso-driver/lib/driver.ts:270:7)
at AppiumDriver.createSession (/usr/local/lib/node_modules/appium/lib/appium.js:384:35)
[dd5d39c0][HTTP] ← POST /session 500 12044 ms - 1150

appium version - 2.15.0
espresso version - 3.5.1

appium capabilities

{
“platformName”: “Android”,
“appium:app”: “/Users/rakeshkarkare/Desktop/Demo_apps/Android_Latest_Build/espresso.apk”,
“appium:deviceName”: “Galaxy Z Fold3 5G”,
“appium:udid”: “RFCT41BTTMT”,
“appium:automationName”: “espresso”,
“appium:forceEspressoRebuild”: true,
“appium:showGradleLog”: true,
“appium:espressoServerLaunchTimeout”: 60000
}

and you build your android app with Espresso framework enabled?

As per dev team they enabled espresso framework in the build

left to check all one by one what mentioned in → GitHub - appium/appium-espresso-driver: Espresso integration for Appium

for example make Espresso version in app = in your appium driver capabilities

As per dev team they added library for espresso and build shared they tried to run the build in android studio as well and it is working for them. Anything else needed to enable the espresso framework ?

Actually I tried troubleshooting steps giving espresso version in capabilities but still got same error

1 try update your espresso CFG to match app you use → GitHub - appium/appium-espresso-driver: Espresso integration for Appium
2 ask your developer help. it will be best to sit together …

Thanks I will get this info from them and will try

I tried adding all configurations but now getting below error

Failed to create session. A new session could not be created. Details: Unable to build Espresso server - Process ended with exitcode 1 (cmd: ‘/var/folders/zt/2dyysqsj0tqbdvrl2r56txwc0000gp/T/espresso-server-RFCT42BTGME/gradlew -PappiumAndroidGradlePlugin=8.7.0 -PappiumCompileSdk=34 -PappiumBuildTools=34 -PappiumMinSdk=24 -PappiumTargetSdk=34 -PappiumKotlin=1.9.20 -PappiumSourceCompatibility=VERSION_17 -PappiumTargetCompatibility=VERSION_17 -PappiumJvmTarget=18 -PappiumComposeVersion=1.7.0-beta03 -PappiumEspressoVersion=3.5.1 -PappiumAnnotationVersion=1.2.0 -PappiumTargetPackage=test.stage app:assembleAndroidTest’) Gradle error message: FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring root project ‘espresso-server-RFCT42BTGME’. > Multiple build operations failed. Could not read workspace metadata from /Users/rakeshkarkare/.gradle/caches/transforms-4/1e346558960820322f7f531005692f5e/metadata.bin Could not read workspace metadata from /Users/rakeshkarkare/.gradle/caches/transforms-4/fd2161c49f2b911bef1e5f5dd70b4aba/metadata.bin Could not read workspace metadata from /Users/rakeshkarkare/.gradle/caches/transforms-4/4d920ac76ab84e02231603dd4a8066e5/metadata.bin Could not read workspace metadata from /Users/rakeshkarkare/.gradle/caches/transforms-4/2fa834a0903d0a137e5fd461c9bf32cf/metadata.bin Could not read workspace metadata from /Users/rakeshkarkare/.gradle/caches/transforms-4/f0562b578f239103d142955d9a3be41d/metadata.bin Could not read workspace metadata from /Users/rakeshkarkare/.gradle/caches/transforms-4/1c2a84acf5aaf901e0dd0f2946dad728/metadata.bin Could not read workspace metadata from

@Aleksei I am still facing issue to run with espresso

[98d63aa8][AppiumDriver@b093] 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 GitHub - appium/appium-espresso-driver: Espresso integration for Appium regarding advanced session startup troubleshooting.
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 GitHub - appium/appium-espresso-driver: Espresso integration for Appium regarding advanced session startup troubleshooting.
at EspressoProxy.command (/Users/rakeshkarkare/node_modules/@appium/base-driver/lib/jsonwp-proxy/proxy.js:350:13)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at EspressoRunner.startSession (/Users/rakeshkarkare/node_modules/appium-espresso-driver/lib/espresso-runner.js:400:5)
at EspressoDriver.startEspressoSession (/Users/rakeshkarkare/node_modules/appium-espresso-driver/lib/driver.ts:467:5)
at EspressoDriver.createSession (/Users/rakeshkarkare/node_modules/appium-espresso-driver/lib/driver.ts:274:7)
at AppiumDriver.createSession (/usr/local/lib/node_modules/appium/lib/appium.js:384:35)
[98d63aa8][HTTP] ← POST /session 500 24576 ms - 1347

Check the driver’s troubleshooting guide. Usually the build fails because of missing or conflicting dependencies. You may try to integrate Espresso server with your AUT code as a possible workaround as it is stated in the first troubleshooting solution.

@mykola-mokhnach Dev team shared new build by integrating espresso server with AUT code as a workaround but still same issue also noticed it is creating .idsig file when trying to invoke using appium inspector

[ae5b9c67][AppiumDriver@814e] Event ‘newSessionStarted’ logged at 1739796076787 (16:41:16 GMT+0400 (Gulf Standard Time))
[ae5b9c67][AppiumDriver@814e] 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 GitHub - appium/appium-espresso-driver: Espresso integration for Appium regarding advanced session startup troubleshooting.
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 GitHub - appium/appium-espresso-driver: Espresso integration for Appium regarding advanced session startup troubleshooting.
at EspressoProxy.command (/Users/rakeshkarkare/node_modules/@appium/base-driver/lib/jsonwp-proxy/proxy.js:350:13)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at EspressoRunner.startSession (/Users/rakeshkarkare/node_modules/appium-espresso-driver/lib/espresso-runner.js:400:5)
at EspressoDriver.startEspressoSession (/Users/rakeshkarkare/node_modules/appium-espresso-driver/lib/driver.ts:467:5)
at EspressoDriver.createSession (/Users/rakeshkarkare/node_modules/appium-espresso-driver/lib/driver.ts:274:7)
at AppiumDriver.createSession (/usr/local/lib/node_modules/appium/lib/appium.js:384:35)
[ae5b9c67][HTTP] ← POST /session 500 35424 ms - 1347

Please provide the full server log

@mykola-mokhnach We tried updating with and without configurations but still getting same issue. Please find server logs for your reference. Also tried with Integrating with possible workaround. Request you to please help to resolve this issue of espresso as we are unable to execute the scripts after jetpack compose addition in our android code. I can’t use UIAutomator as it is very slow for jetpack compose pages.

With espressoBuildConfig

Without espressoBuildConfig

Are you sure you’ve read appium-espresso-driver/docs/as-library.md at master · appium/appium-espresso-driver · GitHub ?

If the server is already integrated with the app then no config as needed because no server needs to be built (skipServerInstallation configures that).

Hi @mykola-mokhnach As per dev team they integrated above workaround by adding espresso server as library. I tried now again with only passing below capabilities.

{
“platformName”: “Android”,
“appium:app”: “/Users/rakeshkarkare/Desktop/Demo_apps/Android_Latest_Build/app.apk”,
“appium:deviceName”: “Galaxy Z Fold3 5G”,
“appium:udid”: “RTDT42MTGZE”,
“appium:automationName”: “espresso”,
“appium:skipServerInstallation”: true
}

But getting below error now

Please check Resources$NotFoundException Resource is not a Drawable · Issue #449 · appium/appium-espresso-driver · GitHub
This error might be the result of conflicting dependencies