How to properly setup Appium with Espresso automation?

I’m trying to investigate Espresso vs UiAutomator2,
but when launching test - appium server fails.

[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

Test output is the following

An unknown server-side error occurred while processing the command. Original error: The process did not start within 30000ms (cmd: ‘/Users/Vitaliy/Library/Android/sdk/platform-tools/adb -P 5037 -s 192…:5555 shell am instrument -w -e debug false io.appium.espressoserver.test/androidx.test.runner.AndroidJUnitRunner’) (Selenium::WebDriver::Error::UnknownError)

The caps are the following:

def android_caps
{
caps: {
disableAndroidWatchers: true,
autoGrantPermissions: true,
androidInstallTimeout: 900000,
forceEspressoRebuild: true,
platformVersion: ‘8.0’,
automationName: ‘Espresso’,
deviceName: ‘Android Emulator’,
platformName: ‘Android’,
app: ENV[‘APP_PATH’],
appPackage: ENV[‘APP_PACKAGE’],
appActivity: ‘com.sphinx_solution.activities.SplashActivity’,
appWaitActivity: ‘com.sphinx_solution.activities.SplashActivity’,
newCommandTimeout: 600,
orientation: ‘PORTRAIT’,
fullReset: reinstall_app? ? true : false,
noReset: reinstall_app? ? false : true,
ignoreUnimportantViews: true,
adbExecTimeout: 90000
},
appium_lib: { server_url: ‘http://127.0.0.1:4723/wd/hub’ }
}
end

I’m using the Genymotion emulator, 8.0 - API 26 on MAC OS
Client is Ruby
I tried appium server as of latest release v1.13.0 and beta v1.14.0-beta.1 - but the issue is the same in both cases.

Thanks in advance for your help and suggestions.

NOTE: with UiAutomator2 my testing works fine.

1 Like

Did you get this figured out? I am struggling to set up Espresso for this and similar reasons.

1 Like

@dawnTestCode did you ask Android dev add Espresso to build?

Yes. And they say it is in there. I know that their tests written in Android Studio use Espresso.

Try to read all error. Sometimes real reason mentioned a bit later. E.g. activity you mention is not started and you need to mention other one.

Okay, thank you. I have scoured the logs and see 2 things that appear relevant.

1- [ADB] Got an error during apksigner execution: Command '/Users/dcode/Library/Android/sdk/build-tools/29.0.1/apksigner verify --print-certs /var/folders/zn/qlw9bsp90cd262m8mhv501xr0000gp/T/io.appium.espressoserver.test_1.13.0_com.aicure.aiview.clinical.master.mobile.apk' exited with code 1 [ADB] apksigner stderr: DOES NOT VERIFY [ADB] ERROR: JAR signer CERT.RSA: JAR signature META-INF/CERT.SF indicates the APK is signed using APK Signature Scheme v2 but no such signature was found. Signature stripped?

2- [debug] [WD Proxy] Proxying [POST /session] to [POST http://localhost:8300/session] with body: {"desiredCapabilities":{"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"Android","deviceName":"Samsung","platformVersion":"7.0","udid":"06157df6b2f41b32","orientation":"PORTRAIT","automationName":"Espresso","forceEspressoRebuild":true,"app":"/Users/dcode/dev/unspecified/aicure/appium-boilerplate/apps/dev11Debug-2019.6.apk","appPackage":"com.aicure.aiview.clinical.master.mobile","appActivity":"com.aicure.aiviewswitch.AiViewSwitch","noReset":false,"newCommandTimeout":999,"autoGrantPermissions":true},"platformName":"Android","deviceName":"06157df6b2f41b32","platformVersion":"7.0","udid":"06157df6b2f41b32","orientation":"PORTRAIT","automationName":"Espresso","forceEspressoRebuild":true,"app":"/Users/dcode/dev/unspecified/aicure/appium-boilerplate/apps/dev11Debug-2019.6.apk","appPackage":"com.aicure.aiview.clinical.master.mobile","appActivit... [debug] [Espresso] [Instrumentation] [STDOUT] io.appium.espressoserver.EspressoServerRunnerTest: [debug] [Espresso] [Instrumentation] [STDOUT] Process crashed while executing startEspressoServer(io.appium.espressoserver.EspressoServerRunnerTest): [debug] [Espresso] [Instrumentation] [STDOUT] android.content.res.Resources$NotFoundException: Drawable com.aicure.aiview.clinical.master.mobile:dimen/button_h_8 with resource ID #0x7f070059 [debug] [Espresso] [Instrumentation] [STDOUT] Caused by: android.content.res.Resources$NotFoundException: Resource "com.aicure.aiview.clinical.master.mobile:dimen/button_h_8" (7f070059) is not a Drawable (color or path): TypedValue{t=0x5/d=0x2b01 a=3 r=0x7f070059}

Is the DOES NOT VERIFY somehow related to this?

1 Like

The issue should be checked with the application developers

@dawnTestCode as mentioned by mykola you should show error to your Android developer.
in your logs real issue is:

Caused by: android.content.res.Resources$NotFoundException:
Resource "com.aicure.aiview.clinical.master.mobile:dimen/button_h_8" (7f070059) is not a Drawable (color or path): TypedValue{t=0x5/d=0x2b01 a=3 r=0x7f070059}

Here is where my lack of mastery of Android development may bite me.

This was his response:

dimen/button_h_8
I assume you want to click some button with its id
The log says you are clicking a dimension

Another note is that this error comes before the app is even up. I see a blank white screen appear and then disappear.

What I hear from you guys is that the DOES NOT VERIFY isn’t the real issue, but this is. Is that right?

They have asked if it is really a problem, and have said that they run espresso tests all the time, but don’t see any errors.

Oh. Now I have found all of the discussion on this Resource Not Found stuff. My developers say they can’t do anything about it.

Here are some links though.


(on top of what mykola has posted).