Appium desktop v1.21.0 unsable to launch debug app by espresso driver

Hi masters,
I’m encountering error when trying to use appium desktop for espresso driver, and here is the error code:

[Instrumentation] INSTRUMENTATION_STATUS: Error=Permission Denial: starting instrumentation ComponentInfo{io.appium.espressoserver.test/androidx.test.runner.AndroidJUnitRunner} from pid=6840, uid=6840 not allowed because package io.appium.espressoserver.test does not have a signature matching the target com.xxxxx.xx.debug

and the capabilities:
{
“automationName”: “Espresso”,
“platformName”: “Android”,
“deviceName”: “qa_1”,
“udid”: “emulator-5554”,
“showGradleLog”: true,
“appPackage”: “com.xxxxx.xx.debug”,
“noReset”: true,
“forceEspressoRebuild”: true,
“noSign”: true
}

I’ve tried some the solutions here, but still get the same result:

  1. Add dependency as https://developer.android.com/training/testing/espresso/setup#groovy mentioned, and re-build the app.
  2. Clean all data in app, and re-install app on emulator.
  3. Reboot emulator
  4. Restart appium desktop
  5. Even copy this apk to another machine

The one thing that got me confused is the description in https://github.com/appium/appium-espresso-driver#troubleshooting,
“Espresso requires the debug APK and app-under-test APK (AUT) to have the same signature. It automatically signs the AUT with the io.appium.espressoserver.test signature. This may have problems if you’re using an outdated Android SDK tools and/or an outdated Java version.”

  1. How do I check if these two signature are the same?
  2. if they don’t, how to i sign them?
  3. Is anything i’m missing here?
1 Like

Hi, did you ever find a solution for this?

Did you find a solution for this ? Could you post your driver capabilities for the working solution

You can store the key on your machine and add the path in the capabilities. Just make sure that it is the same one the app is signed with (ask your developer). I haven’t used Espresso for a few months but when I was using it my caps looked like this:

{
  "platformName": "Android",
  "appium:deviceName": "AndroidSimulator",
  "appium:platformVersion": "11.0",
  "appium:usid": "R52R30EW0FT",
  "appium:appPackage": "your.app.package",
  "appium:appActivity": "your.app.package.views.MainActivity",
  "appium:automationName": "espresso",
  "appium:showGradleLog": "true",
  "appium:useKeyStore": "true",
  "appium:keystorePath": "full/path/to/keystore/on/machine",
  "appium:keystorePassword": "{your keystore password}",
  "appium:keyAlias": "{your key alias}",
  "appium:keyPassword": "{your key password}",
  "appium:forceEspressoRebuild": true
}
1 Like