appium: Appium Server uiautomator2 server apk v.1.9.1 does not exist
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
[35m[MJSONWP][39m 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.
[35m[MJSONWP][39m at ADB.callee$0$0$ (/usr/local/lib/node_modules/appium/node_modules/appium-adb/lib/tools/apk-signing.js:61:11)
[35m[MJSONWP][39m at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
[35m[MJSONWP][39m at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
[35m[MJSONWP][39m at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[35m[MJSONWP][39m at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[35m[MJSONWP][39m 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
}
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 16 (5 by maintainers)
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.
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