This is my current EspressoBuildConfig, now while EspressoDriver creation EspressoServer is getting terminated.
capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, AutomationName.ESPRESSO);
capabilities.setCapability(“appium:espressoBuildConfig:”,
“{ additionalAndroidTestDependencies: [androidx.lifecycle:lifecycle-extensions:2.2.0, androidx.activity:activity:1.3.1, androidx.fragment:fragment:1.2.0, org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.10, com.google.android.material:material:1.3.0, androidx.lifecycle:lifecycle-runtime-ktx:2.3.1, androidx.compose.runtime:runtime-livedata:1.0.2, androidx.lifecycle:lifecycle-livedata-ktx:2.3.1, androidx.appcompat:appcompat:1.2.0 ]}”);
capabilities.setCapability(“appium:forceEspressoRebuild”, true);
capabilities.setCapability(“appium:showGradleLog”, true);
capabilities.setCapability(“appium:espressoServerLaunchTimeout”, 60 * 1000);
Appium version: v1.20.2
Android SDK Build Tools version: 29.0.2
Latest Eclipse Console Logs shows:
[Espresso] Building espresso server in ‘C:\Users\xxxxx\AppData\Local\Temp\espresso-server-ZY224P7335’
[Espresso] Installed Espresso Test Server apk
[Espresso] Starting Espresso Server v1.41.0 with cmd: adb shell am instrument -w -e debug false io.appium.espressoserver.test/androidx.test.runner.AndroidJUnitRunner
[Espresso] Waiting up to 60000ms for Espresso server to be online
[WD Proxy] socket hang up
[WD Proxy] socket hang up
[WD Proxy] socket hang up
[WD Proxy] socket hang up
[WD Proxy] socket hang up
[Espresso] Instrumentation process exited with code 1 from signal null
[Espresso] Espresso server process has been unexpectedly terminated. Check the Appium server log and the logcat output for more details
[Espresso] Restoring hidden api policy to the device default configuration
[HTTP] ← POST /wd/hub/session 500 434583 ms - 2778
Driver info: driver.version: CreateDriver
remote stack trace: Error: Espresso server process has been unexpectedly terminated. Check the Appium server log and the logcat output for more details. Check GitHub - appium/appium-espresso-driver: Espresso integration for Appium regarding advanced session startup troubleshooting.
2022-02-21 14:59:45,838 [TestNG-tests-1] ERROR com.premise.driver.CreateDriver - Throwable while createLocalDriver:::Unable to create a new remote session. Please check the server log for more details. Original error: 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 GitHub - appium/appium-espresso-driver: Espresso integration for Appium regarding advanced session startup troubleshooting.
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:17:03’
Here is the Eclipse Console Logs:
Gradle seems to be taking these espresso config
[Espresso] Building espresso server in ‘C:\Users\asimk\AppData\Local\Temp\espresso-server-ZY224P7335’
[Gradle] [STDOUT] WARNING: The specified Android SDK Build Tools version (28.0.3) is ignored, as it is below the minimum supported version (29.0.2) for Android Gradle Plugin 4.1.1.
[Gradle] [STDOUT] Android SDK Build Tools 29.0.2 will be used.
[Gradle] [STDOUT] To suppress this warning, remove “buildToolsVersion ‘28.0.3’” from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
[ADB] Using ‘apksigner.jar’ from ‘C:\Android\build-tools\29.0.2\lib\apksigner.jar’
[ADB] ‘C:\Users\asimk\AppData\Local\Temp\io.appium.espressoserver.test_1.41.0_com.premise.android.qa.debug_ZY224P7335.apk’ is signed with a non-default certificate
[ADB] Using ‘zipalign.exe’ from ‘C:\Android\build-tools\29.0.2\zipalign.exe’
[ADB] io.appium.espressoserver.test was successfully uninstalled
[Espresso] Uninstalled the obsolete Espresso server package from the device under test
[Espresso] Installing Espresso Test Server apk from the target device (path: ‘C:\Users\asimk\AppData\Local\Temp\io.appium.espressoserver.test_1.41.0_com.premise.android.qa.debug_ZY224P7335.apk’)
[ADB] The application at ‘C:\Users\asimk\AppData\Local\Temp\io.appium.espressoserver.test_1.41.0_com.premise.android.qa.debug_ZY224P7335.apk’ will not be cached, because the device under test has confirmed the support of streamed installs
[ADB] The installation of ‘io.appium.espressoserver.test_1.41.0_com.premise.android.qa.debug_ZY224P7335.apk’ took 2048ms
[Espresso] Installed Espresso Test Server apk ‘C:\Users\asimk\AppData\Local\Temp\io.appium.espressoserver.test_1.41.0_com.premise.android.qa.debug_ZY224P7335.apk’ (pkg: ‘io.appium.espressoserver.test’)
[ADB] Adding packages [“io.appium.settings”,“io.appium.espressoserver.test”] to Doze whitelist
[Espresso] Starting Espresso Server v1.41.0 with cmd: adb shell am instrument -w -e debug false io.appium.espressoserver.test/androidx.test.runner.AndroidJUnitRunner
[Espresso] Waiting up to 60000ms for Espresso server to be online
[WD Proxy] socket hang up
[WD Proxy] socket hang up
[WD Proxy] socket hang up
[Espresso] Instrumentation process exited with code 1 from signal null
[Espresso] Espresso server process has been unexpectedly terminated. Check the Appium server log and the logcat output for more details
[Espresso] Restoring hidden api policy to the device default configuration
[HTTP] ← POST /wd/hub/session 500 201730 ms - 2472
[HTTP]
2022-02-21 17:54:00,559 [TestNG-tests-1] ERROR com.premise.driver.CreateDriver - Throwable while createLocalDriver:::Unable to create a new remote session. Please check the server log for more details. Original error: 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 GitHub - appium/appium-espresso-driver: Espresso integration for Appium regarding advanced session startup troubleshooting.
[Gradle] [STDERR] Execution failed for task ‘:app:processDebugMainManifest’.
Eclipse IDE
How to fix this issue now?
Appium version: v1.23.0-beta.0
EspressoDriver version: 1.50.1
Console Error:
org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Please check the server log for more details. Original error: A new session could not be created. Details: Unable to build Espresso server - Process ended with exitcode 1 (cmd: ‘gradlew.bat -PappiumTargetPackage=com.premise.android.qa.debug app:assembleAndroidTest’)