question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(v2) appium install driver deletes previous installed driver(s) when installing multiple drivers.

See original GitHub issue

The problem

I installed appium 2.0.0-beta.27 via npm, first installed uiautomator2 driver - run test with uiautomator2 -> all ok then installed espresso driver - run test with uiautomator2 again -> error:

Could not start a new session. Response code 500. Message: An unknown server-side error occurred while processing the command. Original error: Could not find a driver for automationName 'UIAutomator2' and platformName android'. Have you installed a driver that supports those capabilities? Run 'appium driver list --installed' to see. (Lower-level error: Cannot find module '/home/cmaganu/.appium/node_modules/appium-uiautomator2-driver

Environment

  • Appium version (or git revision) that exhibits the issue: 2.0.0-beta.27
  • Last Appium version that did not exhibit the issue (if applicable): -
  • Desktop OS/version used to run Appium: Ubunntu 20.10
  • Node.js version (unless using Appium.app|exe): v16.14.2
  • Npm or Yarn package manager: npm 8.5.5
  • Mobile platform/version under test: Android 10
  • Real device or emulator/simulator: emulator
  • Appium CLI or Appium.app|exe: cli

Details

  • after appium driver install uiautomator2:
cmaganu@cma-x1:~/git/lt-appium-mobile-tests(main)$ ls -Al ~/.appium/node_modules/
total 128
drwxrwxr-x 5 cmaganu cmaganu   4096 mar 28 16:45 appium-uiautomator2-driver
drwxrwxr-x 3 cmaganu cmaganu   4096 mar 28 16:45 .cache
-rw-rw-r-- 1 cmaganu cmaganu 121877 mar 28 16:45 .package-lock.json
cmaganu@cma-x1:~/git/lt-appium-mobile-tests(main)$ cat  ~/.appium/node_modules/.cache/appium/extensions.yaml 
drivers:
  uiautomator2:
    automationName: UiAutomator2
    platformNames:
      - Android
    mainClass: AndroidUiautomator2Driver
    pkgName: appium-uiautomator2-driver
    version: 2.0.5
    installType: npm
    installSpec: uiautomator2
plugins: {}
schemaRev: 2
cmaganu@cma-x1:~/git/lt-appium-mobile-tests(main)$ appium driver list --installed
✔ Listing installed drivers
- uiautomator2@2.0.5 [installed (NPM)]
  • after appium driver install espresso:
cmaganu@cma-x1:~/git/lt-appium-mobile-tests(main)$ appium driver list --installed
✔ Listing installed drivers
- uiautomator2@2.0.5 [installed (NPM)]
- espresso@2.2.0 [installed (NPM)]
cmaganu@cma-x1:~/git/lt-appium-mobile-tests(main)$ ls -Al ~/.appium/node_modules/
total 708
drwxrwxr-x 6 cmaganu cmaganu   4096 mar 28 16:49 appium-espresso-driver
drwxrwxr-x 3 cmaganu cmaganu   4096 mar 28 16:45 .cache
-rw-rw-r-- 1 cmaganu cmaganu 714864 mar 28 16:49 .package-lock.json
cmaganu@cma-x1:~/git/lt-appium-mobile-tests(main)$ cat  ~/.appium/node_modules/.cache/appium/extensions.yaml 
drivers:
  uiautomator2:
    automationName: UiAutomator2
    platformNames:
      - Android
    mainClass: AndroidUiautomator2Driver
    pkgName: appium-uiautomator2-driver
    version: 2.0.5
    installType: npm
    installSpec: uiautomator2
  espresso:
    automationName: Espresso
    platformNames:
      - Android
    mainClass: EspressoDriver
    pkgName: appium-espresso-driver
    version: 2.2.0
    installType: npm
    installSpec: espresso
plugins: {}
schemaRev: 2

.appium/package.json is empty

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
cmaganucommented, Mar 28, 2022

As for a workaround I just backed up the folder for the first driver (say uiautomator2) and copied it back after the installation of the second driver. 😄

1reaction
boneskullcommented, Mar 28, 2022

OK, I have a fix, will send a PR once I write a test for it.

you can workaround this by manually editing ~/.appium/package.json like so:

  {
    "dependencies": {
      "appium-espresso-driver": "^2.2.0",
      "appium-uiautomator2-driver": "^2.0.5"
    }
  }
Read more comments on GitHub >

github_iconTop Results From Across the Web

Installing Appium 2.0 and the Driver and Plugins CLI - HeadSpin
Use the "Appium driver" command to install the one(s) you want to use. ... That's because no drivers are included by default with...
Read more >
Troubleshooting - Appium
When installing on Mac, make sure the user has write permissions for /usr/local/lib or install Appium ... After setting power state to off...
Read more >
UIAutomator2 (Android) - Appium
Appium's flagship support for automating Android apps is via the UiAutomator2 driver. (New to Appium? Read our introduction to Appium drivers). This driver...
Read more >
Getting Started - Appium
Appium can be installed in one of two ways: via NPM or by downloading Appium Desktop, which is a graphical, desktop-based way to...
Read more >
Error installing driver with Appium 2.0 - Support
I'm trying the latest Appium 2.0 and I get this error when trying to install individual drivers. Anyone know what the problem is?...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found