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.

Appium Server uiautomator2 server apk v.1.9.1 does not exist

See original GitHub issue

The problem

Running appium on Android is not currently possible after recent release of appium uiautomator2 server https://github.com/appium/appium-uiautomator2-server/releases. Now when trying to run Android tests on CI, the following issue occurs:

An unknown server-side error occurred while processing the command. Original error: /usr/local/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v1.9.1.apk file doesn't exist. (Selenium::WebDriver::Error::UnknownError)
/Users/distiller/vendor/bundle/ruby/2.3.0/gems/selenium-webdriver-3.6.0/lib/selenium/webdriver/remote/response.rb:71:in `assert_ok'
/Users/distiller/vendor/bundle/ruby/2.3.0/gems/selenium-webdriver-3.6.0/lib/selenium/webdriver/remote/response.rb:34:in `initialize'
/Users/distiller/vendor/bundle/ruby/2.3.0/gems/selenium-webdriver-3.6.0/lib/selenium/webdriver/remote/http/common.rb:83:in `new'
/Users/distiller/vendor/bundle/ruby/2.3.0/gems/selenium-webdriver-3.6.0/lib/selenium/webdriver/remote/http/common.rb:83:in `create_response'
/Users/distiller/vendor/bundle/ruby/2.3.0/gems/selenium-webdriver-3.6.0/lib/selenium/webdriver/remote/http/default.rb:106:in `request'
/Users/distiller/vendor/bundle/ruby/2.3.0/gems/selenium-webdriver-3.6.0/lib/selenium/webdriver/remote/http/common.rb:61:in `call'
/Users/distiller/vendor/bundle/ruby/2.3.0/gems/appium_lib-9.6.1/lib/appium_lib/common/patch.rb:140:in `execute'
/Users/distiller/vendor/bundle/ruby/2.3.0/gems/selenium-webdriver-3.6.0/lib/selenium/webdriver/remote/bridge.rb:103:in `create_session'
/Users/distiller/vendor/bundle/ruby/2.3.0/gems/selenium-webdriver-3.6.0/lib/selenium/webdriver/remote/bridge.rb:54:in `handshake'
/Users/distiller/vendor/bundle/ruby/2.3.0/gems/selenium-webdriver-3.6.0/lib/selenium/webdriver/remote/driver.rb:39:in `initialize'
/Users/distiller/vendor/bundle/ruby/2.3.0/gems/selenium-webdriver-3.6.0/lib/selenium/webdriver/common/driver.rb:58:in `new'
/Users/distiller/vendor/bundle/ruby/2.3.0/gems/selenium-webdriver-3.6.0/lib/selenium/webdriver/common/driver.rb:58:in `for'
/Users/distiller/vendor/bundle/ruby/2.3.0/gems/selenium-webdriver-3.6.0/lib/selenium/webdriver.rb:86:in `for'
/Users/distiller/vendor/bundle/ruby/2.3.0/gems/appium_lib-9.6.1/lib/appium_lib/driver.rb:698:in `start_driver'
/Users/distiller/mobile/features/support/env.rb:40:in `<top (required)>'
/Users/distiller/vendor/bundle/ruby/2.3.0/gems/cucumber-3.0.2/lib/cucumber/glue/registry_and_more.rb:106:in `load'
/Users/distiller/vendor/bundle/ruby/2.3.0/gems/cucumber-3.0.2/lib/cucumber/glue/registry_and_more.rb:106:in `load_code_file'
/Users/distiller/vendor/bundle/ruby/2.3.0/gems/cucumber-3.0.2/lib/cucumber/runtime/support_code.rb:147:in `load_file'
/Users/distiller/vendor/bundle/ruby/2.3.0/gems/cucumber-3.0.2/lib/cucumber/runtime/support_code.rb:88:in `block in load_files!'
/Users/distiller/vendor/bundle/ruby/2.3.0/gems/cucumber-3.0.2/lib/cucumber/runtime/support_code.rb:87:in `each'
/Users/distiller/vendor/bundle/ruby/2.3.0/gems/cucumber-3.0.2/lib/cucumber/runtime/support_code.rb:87:in `load_files!'
/Users/distiller/vendor/bundle/ruby/2.3.0/gems/cucumber-3.0.2/lib/cucumber/runtime.rb:270:in `load_step_definitions'
/Users/distiller/vendor/bundle/ruby/2.3.0/gems/cucumber-3.0.2/lib/cucumber/runtime.rb:67:in `run!'

/Users/distiller/vendor/bundle/ruby/2.3.0/gems/cucumber-3.0.2/lib/cucumber/cli/main.rb:33:in `execute!'
/Users/distiller/vendor/bundle/ruby/2.3.0/gems/cucumber-3.0.2/bin/cucumber:9:in `<top (required)>'
/Users/distiller/vendor/bundle/ruby/2.3.0/bin/cucumber:22:in `load'
/Users/distiller/vendor/bundle/ruby/2.3.0/bin/cucumber:22:in `<top (required)>'
/Users/distiller/.gem/ruby/2.3.5/gems/bundler-1.15.4/lib/bundler/cli/exec.rb:74:in `load'
/Users/distiller/.gem/ruby/2.3.5/gems/bundler-1.15.4/lib/bundler/cli/exec.rb:74:in `kernel_load'
/Users/distiller/.gem/ruby/2.3.5/gems/bundler-1.15.4/lib/bundler/cli/exec.rb:27:in `run'
/Users/distiller/.gem/ruby/2.3.5/gems/bundler-1.15.4/lib/bundler/cli.rb:362:in `exec'
/Users/distiller/.gem/ruby/2.3.5/gems/bundler-1.15.4/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/Users/distiller/.gem/ruby/2.3.5/gems/bundler-1.15.4/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/Users/distiller/.gem/ruby/2.3.5/gems/bundler-1.15.4/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/Users/distiller/.gem/ruby/2.3.5/gems/bundler-1.15.4/lib/bundler/cli.rb:22:in `dispatch'
/Users/distiller/.gem/ruby/2.3.5/gems/bundler-1.15.4/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
/Users/distiller/.gem/ruby/2.3.5/gems/bundler-1.15.4/lib/bundler/cli.rb:13:in `start'
/Users/distiller/.gem/ruby/2.3.5/gems/bundler-1.15.4/exe/bundle:30:in `block in <top (required)>'
/Users/distiller/.gem/ruby/2.3.5/gems/bundler-1.15.4/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
/Users/distiller/.gem/ruby/2.3.5/gems/bundler-1.15.4/exe/bundle:22:in `<top (required)>'
/Users/distiller/.gem/ruby/2.3.5/bin/bundle:22:in `load'
/Users/distiller/.gem/ruby/2.3.5/bin/bundle:22:in `<main>'

Environment

  • Appium version (or git revision) that exhibits the issue: 1.8.0
  • Last Appium version that did not exhibit the issue (if applicable): 1.8.0
  • Desktop OS/version used to run Appium: CircleCI MacOS
  • Node.js version (unless using Appium.app|exe): 8 (brew install node@8 --ignore-dependencies)
  • Mobile platform/version under test:
- sdkmanager "platform-tools" "platforms;android-25" "extras;intel;Hardware_Accelerated_Execution_Manager" "build-tools;25.0.0" "system-images;android-25;google_apis;x86" "emulator" --verbose
      - avdmanager create avd -n nexus5 -k "system-images;android-25;google_apis;x86" -g google_apis -d "Nexus 5"
      - /usr/local/share/android-sdk/tools/emulator @nexus5 -skin 1080x2066:
  • Real device or emulator/simulator: Simulator
  • Appium CLI or Appium.app|exe: Appium CLI

Details

If necessary, describe the problem you have been experiencing in more detail.

Link to Appium logs

These are full logs

[MJSONWP] Encountered internal error running command: Error: /usr/local/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v1.9.1.apk file doesn't exist.
[MJSONWP]     at ADB.callee$0$0$ (/usr/local/lib/node_modules/appium/node_modules/appium-adb/lib/tools/apk-signing.js:61:11)
[MJSONWP]     at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
[MJSONWP]     at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
[MJSONWP]     at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[MJSONWP]     at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[MJSONWP]     at <anonymous>

Code To Reproduce Issue [ Good To Have ]

Run any Appium test against Android device with the following capabilities:

       {
        platformName: 'Android',
        deviceName: 'nexus5',
        platformVersion: '7.1.1',
        app: <whatever_here>,
        automationName: 'UiAutomator2',
        avd: 'nexus5',
        autoGrantPermissions: true
      }

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:16 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
cosminstirbucommented, Oct 29, 2018

I’ve temporarily disabled the antivirus. However I’ve heard from colleagues that with the latest virus database definition they’ve fixed this. Can’t confirm though.

1reaction
cosminstirbucommented, Aug 11, 2018

Digging deeper, it seems this is an issue caused by my Bitdefender Endpoint Security for Mac Antivirus …

8/11/18, 3:41 PM Android.Trojan.Neucore.gTVSN deleted /usr/local/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v1.12.0.apk=>classes.dex

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to launch app on real device getting an error when ...
I am using Appium: 1.9.1 Selenium 3.12.0 and java-client', version: '6.1.0' … When i was running my script then Unable to launch app...
Read more >
appium-uiautomator2-server - npm
A netty server with uiautomator2 handlers. Latest version: 5.7.5, last published: 12 days ago. Start using appium-uiautomator2-server in ...
Read more >
Getting Proxy error while running appium test for Android
Make sure you are using latest Appium server 1.9.1. Latest Android SDK and ADB is installed. Uninstall your app, Appium setting and unlock ......
Read more >
Capabilities for running mobile app tests on BrowserStack
Appium provides a series of capabilities that you can set for the Appium version you are running. Appium server on the BrowserStack will...
Read more >
appium/appium - Gitter
iOS Query - Does anyone know of a way to Shard tests across cloned iOS sims as per ... target 'io.appium.uiautomator2.server.test/androidx.test.runner.
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