Appium 1.17.1 with Espresso - Session start failed

@mykola-mokhnach You were right once again, thank you so much!!

But unfortunatelly I still get another error:

[HTTP] --> POST /wd/hub/session
[HTTP] {“desiredCapabilities”:{“app”:“C:\Users\furbn\Downloads\tiktok.apk”,“deviceName”:“WCR7N18904000418”,“noReset”:true,“unlockType”:“pin”,“unlockKey”:“5145”,“automationName”:“espresso”,“noSign”:false,“platformName”:“Android”},“capabilities”:{“firstMatch”:[{“platformName”:“Android”}]}}
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{“app”:“C:\Users\furbn\Downloads\tiktok.apk”,“deviceName”:“WCR7N18904000418”,“noReset”:true,“unlockType”:“pin”,“unlockKey”:“5145”,“automationName”:“espresso”,“noSign”:false,“platformName”:“Android”},null,{“firstMatch”:[{“platformName”:“Android”}]}]
[debug] [BaseDriver] Event ‘newSessionRequested’ logged at 1589543411775 (13:50:11 GMT+0200 (GMT+02:00))
[BaseDriver] The following capabilities are not standard capabilities and should have an extension prefix:
[BaseDriver] automationName
[Appium] The following capabilities were provided in the JSONWP desired capabilities that are missing in W3C capabilities: [“app”,“deviceName”,“noReset”,“unlockType”,“unlockKey”,“noSign”]
[Appium] Trying to fix W3C capabilities by merging them with JSONWP caps
[BaseDriver] The following capabilities are not standard capabilities and should have an extension prefix:
[BaseDriver] app
[BaseDriver] deviceName
[BaseDriver] noReset
[BaseDriver] unlockType
[BaseDriver] unlockKey
[BaseDriver] noSign
[BaseDriver] automationName
[Appium] Appium v1.17.1 creating new EspressoDriver (v1.23.2) session
[debug] [Appium] There are no active sessions for cleanup
[debug] [BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided
[debug] [BaseDriver] Creating session with W3C capabilities: {
[debug] [BaseDriver] “alwaysMatch”: {
[debug] [BaseDriver] “appium:app”: “C:\Users\furbn\Downloads\tiktok.apk”,
[debug] [BaseDriver] “appium:deviceName”: “WCR7N18904000418”,
[debug] [BaseDriver] “appium:noReset”: true,
[debug] [BaseDriver] “appium:unlockType”: “pin”,
[debug] [BaseDriver] “appium:unlockKey”: “5145”,
[debug] [BaseDriver] “appium:noSign”: false,
[debug] [BaseDriver] “platformName”: “Android”,
[debug] [BaseDriver] “appium:automationName”: “espresso”
[debug] [BaseDriver] },
[debug] [BaseDriver] “firstMatch”: [
[debug] [BaseDriver] {}
[debug] [BaseDriver] ]
[debug] [BaseDriver] }
[BaseDriver] Session created with session id: 1174d0c3-5a8d-4d21-a4b1-3c83c1bdfd12
[BaseDriver] Using local app ‘C:\Users\furbn\Downloads\tiktok.apk’
[debug] [Espresso] Checking whether app is actually present
[Espresso] EspressoDriver version: 1.23.2
[ADB] Using ‘adb.exe’ from ‘C:\Users\furbn\AppData\Local\Android\android-sdk\platform-tools\adb.exe’
[AndroidDriver] Retrieving device list
[debug] [ADB] Trying to find a connected android device
[debug] [ADB] Getting connected devices…
[debug] [ADB] Connected devices: [{“udid”:“WCR7N18904000418”,“state”:“device”}]
[AndroidDriver] Using device: WCR7N18904000418
[ADB] Using ‘adb.exe’ from ‘C:\Users\furbn\AppData\Local\Android\android-sdk\platform-tools\adb.exe’
[debug] [ADB] Setting device id to WCR7N18904000418
[debug] [ADB] Running ‘C:\Users\furbn\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s WCR7N18904000418 shell getprop ro.build.version.sdk’
[debug] [ADB] Current device property ‘ro.build.version.sdk’: 27
[debug] [ADB] Device API level: 27
[debug] [AndroidDriver] Parsing package and activity from app manifest
[ADB] Package name: ‘com.ss.android.ugc.trill’
[ADB] Main activity name: ‘com.ss.android.ugc.aweme.splash.SplashActivity’
[debug] [AndroidDriver] Parsed package and activity are: com.ss.android.ugc.trill/com.ss.android.ugc.aweme.splash.SplashActivity
[debug] [ADB] Running ‘C:\Users\furbn\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s WCR7N18904000418 wait-for-device’
[debug] [ADB] Running ‘C:\Users\furbn\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s WCR7N18904000418 shell echo ping’
[debug] [AndroidDriver] Pushing settings apk to device…
[debug] [ADB] Getting install status for io.appium.settings
[debug] [ADB] Running ‘C:\Users\furbn\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s WCR7N18904000418 shell dumpsys package io.appium.settings’
[debug] [ADB] ‘io.appium.settings’ is installed
[debug] [ADB] Getting package info for ‘io.appium.settings’
[debug] [ADB] Running ‘C:\Users\furbn\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s WCR7N18904000418 shell dumpsys package io.appium.settings’
[debug] [ADB] The version name of the installed ‘io.appium.settings’ is greater or equal to the application version name (‘3.1.0’ >= ‘3.1.0’)
[debug] [ADB] There is no need to install/upgrade ‘C:\Users\furbn\AppData\Roaming\npm\node_modules\appium\node_modules\io.appium.settings\apks\settings_apk-debug.apk’
[debug] [ADB] Getting IDs of all ‘io.appium.settings’ processes
[debug] [ADB] Running ‘C:\Users\furbn\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s WCR7N18904000418 shell ‘pgrep --help; echo $?’’
[debug] [ADB] Running ‘C:\Users\furbn\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s WCR7N18904000418 shell pgrep -f io\.appium\.settings’
[debug] [AndroidDriver] io.appium.settings is already running. There is no need to reset its permissions.
[debug] [ADB] Running ‘C:\Users\furbn\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s WCR7N18904000418 shell appops set io.appium.settings android:mock_location allow’
[debug] [Logcat] Starting logcat capture
[debug] [ADB] Running ‘C:\Users\furbn\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s WCR7N18904000418 shell settings get global animator_duration_scale’
[debug] [ADB] Running ‘C:\Users\furbn\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s WCR7N18904000418 shell settings get global transition_animation_scale’
[debug] [ADB] Running ‘C:\Users\furbn\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s WCR7N18904000418 shell settings get global window_animation_scale’
[debug] [Espresso] Forwarding Espresso Server port 6791 to 8301
[debug] [ADB] Forwarding system: 8301 to device: 6791
[debug] [ADB] Running ‘C:\Users\furbn\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s WCR7N18904000418 forward tcp:8301 tcp:6791’
[debug] [ADB] Running ‘C:\Users\furbn\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s WCR7N18904000418 shell dumpsys window’
[AndroidDriver] Screen already unlocked, doing nothing
[debug] [ADB] Checking app cert for C:\Users\furbn\Downloads\tiktok.apk
[ADB] Using ‘apksigner.jar’ from ‘C:\Users\furbn\AppData\Local\Android\android-sdk\build-tools\28.0.3\lib\apksigner.jar’
[debug] [ADB] Starting apksigner: ‘C:\Program Files\Java\jdk1.8.0_201\bin\java.exe’ -Xmx1024M -Xss1m -jar C:\Users\furbn\AppData\Local\Android\android-sdk\build-tools\28.0.3\lib\apksigner.jar verify --print-certs C:\Users\furbn\Downloads\tiktok.apk
[debug] [ADB] apksigner stdout: Signer #1 certificate DN: [email protected], CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US
[debug] [ADB] Signer #1 certificate SHA-256 digest: a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc
[debug] [ADB] Signer #1 certificate SHA-1 digest: 61ed377e85d386a8dfee6b864bd85b0bfaa5af81
[debug] [ADB] Signer #1 certificate MD5 digest: e89b158e4bcf988ebd09eb83f5378e87
[debug] [ADB]
[debug] [ADB] ‘C:\Users\furbn\Downloads\tiktok.apk’ is signed with the default certificate
[debug] [ADB] Getting install status for com.ss.android.ugc.trill
[debug] [ADB] Running ‘C:\Users\furbn\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s WCR7N18904000418 shell dumpsys package com.ss.android.ugc.trill’
[debug] [ADB] ‘com.ss.android.ugc.trill’ is not installed
[debug] [ADB] App ‘C:\Users\furbn\Downloads\tiktok.apk’ is not installed
[debug] [ADB] Installing ‘C:\Users\furbn\Downloads\tiktok.apk’
[debug] [ADB] Running ‘C:\Users\furbn\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s WCR7N18904000418 features’
[ADB] The application at ‘C:\Users\furbn\Downloads\tiktok.apk’ will not be cached, because the device under test has confirmed the support of streamed installs
[debug] [ADB] Running ‘C:\Users\furbn\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s WCR7N18904000418 install C:\Users\furbn\Downloads\tiktok.apk’
[ADB] The installation of ‘tiktok.apk’ took 16298ms
[debug] [ADB] Install command stdout: Performing Streamed Install
[debug] [ADB] Success
[debug] [ADB] Running ‘C:\Users\furbn\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s WCR7N18904000418 shell ls /data/local/tmp/espresso.apppackage’
[debug] [Espresso] The previous target application package is unknown
[Espresso] Forcing Espresso server rebuild because of changed application package
[debug] [Espresso] Deleting the obsolete Espresso server package ‘C:\Users\furbn\AppData\Local\Temp\io.appium.espressoserver.test_1.23.2_com.ss.android.ugc.trill_WCR7N18904000418.apk’
[Espresso] Building espresso server in ‘C:\Users\furbn\AppData\Local\Temp\espresso-server-WCR7N18904000418’
[debug] [Espresso] The build folder root could be customized by changing the ‘tmpDir’ capability
[debug] [Espresso] Copying espresso server template from (‘C:\Users\furbn\AppData\Roaming\npm\node_modules\appium\node_modules\appium-espresso-driver\espresso-server’ to ‘C:\Users\furbn\AppData\Local\Temp\espresso-server-WCR7N18904000418’)
[debug] [Support] Traversed 49 directories and 250 files in 260ms
[debug] [Espresso] Bulding espresso server
[debug] [Espresso] Beginning build with command ‘gradlew.bat -PappiumTargetPackage=com.ss.android.ugc.trill assembleAndroidTest’ in directory ‘C:\Users\furbn\AppData\Local\Temp\espresso-server-WCR7N18904000418’
[debug] [Espresso] Output from Gradle will not be logged. To change this, use ‘showGradleLog’ desired capability
[debug] [Espresso] Copying built apk from ‘C:\Users\furbn\AppData\Local\Temp\espresso-server-WCR7N18904000418\app\build\outputs\apk\androidTest\debug\app-debug-androidTest.apk’ to ‘C:\Users\furbn\AppData\Local\Temp\io.appium.espressoserver.test_1.23.2_com.ss.android.ugc.trill_WCR7N18904000418.apk’
[debug] [ADB] Checking app cert for C:\Users\furbn\AppData\Local\Temp\io.appium.espressoserver.test_1.23.2_com.ss.android.ugc.trill_WCR7N18904000418.apk
[debug] [ADB] Starting apksigner: ‘C:\Program Files\Java\jdk1.8.0_201\bin\java.exe’ -Xmx1024M -Xss1m -jar C:\Users\furbn\AppData\Local\Android\android-sdk\build-tools\28.0.3\lib\apksigner.jar verify --print-certs C:\Users\furbn\AppData\Local\Temp\io.appium.espressoserver.test_1.23.2_com.ss.android.ugc.trill_WCR7N18904000418.apk
[debug] [ADB] apksigner stdout: Signer #1 certificate DN: C=US, O=Android, CN=Android Debug
[debug] [ADB] Signer #1 certificate SHA-256 digest: 741cc34adc8550120fc463c7a8a74ba2182b3381649cb5ac9b569bb53ac1ec79
[debug] [ADB] Signer #1 certificate SHA-1 digest: 9884022793c6319e0e64fb4d5ee09e979d042868
[debug] [ADB] Signer #1 certificate MD5 digest: 77def06932b26e4c79a518478a8c4962
[debug] [ADB]
[debug] [ADB] ‘C:\Users\furbn\AppData\Local\Temp\io.appium.espressoserver.test_1.23.2_com.ss.android.ugc.trill_WCR7N18904000418.apk’ is signed with a non-default certificate
[ADB] Using ‘zipalign.exe’ from ‘C:\Users\furbn\AppData\Local\Android\android-sdk\build-tools\28.0.3\zipalign.exe’
[debug] [ADB] C:\Users\furbn\AppData\Local\Temp\io.appium.espressoserver.test_1.23.2_com.ss.android.ugc.trill_WCR7N18904000418.apk’ is already zip-aligned. Doing nothing
[debug] [ADB] Signing ‘C:\Users\furbn\AppData\Local\Temp\io.appium.espressoserver.test_1.23.2_com.ss.android.ugc.trill_WCR7N18904000418.apk’ with default cert
[debug] [ADB] Starting apksigner: ‘C:\Program Files\Java\jdk1.8.0_201\bin\java.exe’ -Xmx1024M -Xss1m -jar C:\Users\furbn\AppData\Local\Android\android-sdk\build-tools\28.0.3\lib\apksigner.jar sign --key C:\Users\furbn\AppData\Roaming\npm\node_modules\appium\node_modules\appium-adb\keys\testkey.pk8 --cert C:\Users\furbn\AppData\Roaming\npm\node_modules\appium\node_modules\appium-adb\keys\testkey.x509.pem C:\Users\furbn\AppData\Local\Temp\io.appium.espressoserver.test_1.23.2_com.ss.android.ugc.trill_WCR7N18904000418.apk
[debug] [ADB] Uninstalling io.appium.espressoserver.test
[debug] [ADB] Getting install status for io.appium.espressoserver.test
[debug] [ADB] Running ‘C:\Users\furbn\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s WCR7N18904000418 shell dumpsys package io.appium.espressoserver.test’
[debug] [ADB] ‘io.appium.espressoserver.test’ is installed
[debug] [ADB] Running ‘C:\Users\furbn\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s WCR7N18904000418 shell am force-stop io.appium.espressoserver.test’
[debug] [ADB] Running ‘C:\Users\furbn\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s WCR7N18904000418 uninstall io.appium.espressoserver.test’
[debug] [ADB] ‘adb uninstall io.appium.espressoserver.test’ command output: Success
[ADB] io.appium.espressoserver.test was successfully uninstalled
[Espresso] Uninstalled the obsolete Espresso server package from the device under test
[debug] [ADB] Getting install status for io.appium.espressoserver.test
[debug] [ADB] Running ‘C:\Users\furbn\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s WCR7N18904000418 shell dumpsys package io.appium.espressoserver.test’
[debug] [ADB] ‘io.appium.espressoserver.test’ is not installed
[debug] [ADB] App ‘C:\Users\furbn\AppData\Local\Temp\io.appium.espressoserver.test_1.23.2_com.ss.android.ugc.trill_WCR7N18904000418.apk’ is not installed
[Espresso] Installing Espresso Test Server apk from the target device (path: ‘C:\Users\furbn\AppData\Local\Temp\io.appium.espressoserver.test_1.23.2_com.ss.android.ugc.trill_WCR7N18904000418.apk’)
[ADB] The application at ‘C:\Users\furbn\AppData\Local\Temp\io.appium.espressoserver.test_1.23.2_com.ss.android.ugc.trill_WCR7N18904000418.apk’ will not be cached, because the device under test has confirmed the support of streamed installs
[debug] [ADB] Running ‘C:\Users\furbn\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s WCR7N18904000418 install C:\Users\furbn\AppData\Local\Temp\io.appium.espressoserver.test_1.23.2_com.ss.android.ugc.trill_WCR7N18904000418.apk’
[ADB] The installation of ‘io.appium.espressoserver.test_1.23.2_com.ss.android.ugc.trill_WCR7N18904000418.apk’ took 1885ms
[debug] [ADB] Install command stdout: Performing Streamed Install
[debug] [ADB] Success
[Espresso] Installed Espresso Test Server apk ‘C:\Users\furbn\AppData\Local\Temp\io.appium.espressoserver.test_1.23.2_com.ss.android.ugc.trill_WCR7N18904000418.apk’ (pkg: ‘io.appium.espressoserver.test’)
[debug] [Espresso] Performing cleanup of automation leftovers
[debug] [Espresso] No obsolete sessions have been detected (Error: socket hang up)
[Espresso] Starting Espresso Server v1.23.2 with cmd: adb shell am instrument -w -e debug false io.appium.espressoserver.test/androidx.test.runner.AndroidJUnitRunner
[debug] [ADB] Creating ADB subprocess with args: ["-P",5037,"-s",“WCR7N18904000418”,“shell”,“am”,“instrument”,"-w","-e",“debug”,“false”,“io.appium.espressoserver.test/androidx.test.runner.AndroidJUnitRunner”]
[debug] [Espresso] [Instrumentation] [STDOUT] INSTRUMENTATION_RESULT: shortMsg=Process crashed.
[debug] [Espresso] [Instrumentation] [STDOUT] INSTRUMENTATION_CODE: 0
[Espresso] Instrumentation process exited with code 0 from signal null
[debug] [Espresso] Deleting espresso session
[debug] [ADB] Running ‘C:\Users\furbn\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s WCR7N18904000418 shell am force-stop com.ss.android.ugc.trill’
[debug] [Logcat] Stopping logcat capture
[debug] [ADB] Removing forwarded port socket connection: 8301
[debug] [ADB] Running ‘C:\Users\furbn\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s WCR7N18904000418 forward --remove tcp:8301’
[debug] [BaseDriver] Event ‘newSessionStarted’ logged at 1589543483080 (13:51:23 GMT+0200 (GMT+02:00))
[debug] [W3C] Encountered internal error running command: A new session could not be created. Details: The process did not start within 30000ms (cmd: ‘C:\Users\furbn\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s WCR7N18904000418 shell am instrument -w -e debug false io.appium.espressoserver.test/androidx.test.runner.AndroidJUnitRunner’). Check https://github.com/appium/appium-espresso-driver#troubleshooting regarding advanced session startup troubleshooting.
[debug] [W3C] Error: The process did not start within 30000ms (cmd: ‘C:\Users\furbn\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s WCR7N18904000418 shell am instrument -w -e debug false io.appium.espressoserver.test/androidx.test.runner.AndroidJUnitRunner’)
[debug] [W3C] at Timeout._onTimeout (C:\Users\furbn\AppData\Roaming\npm\node_modules\appium\node_modules\teen_process\lib\subprocess.js:197:18)
[debug] [W3C] at listOnTimeout (internal/timers.js:549:17)
[debug] [W3C] at processTimers (internal/timers.js:492:7)
[debug] [W3C] Destroying socket connection
[HTTP] <-- POST /wd/hub/session 500 71309 ms - 1053