appium / appium/java-client

java.lang.NoClassDefFoundError: org/openqa/selenium/Capabilities

Open
#1,127 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.3k
Forks
752
Avg merge
6d 21h
Merged PRs (30d)
8

Description

The problem

Hi there, I am trying to use Appium with a remote server in my local network. Using older version of the Appium Server (the 1.6.2 works fine, but XCode there is 10.1 and an older bug reads it as a 0.1).
Since the last version (server should be 1.11) don't have that bug I am currently using it. But my old code using RemoteWebDriver is not working.

So I tried switching to AndroidDriver, but I got some problem.

Environment

  • Appium (java client) version: tried 7.0.0, 6.0.0 and 6.1.0 no one works
  • Desktop OS/version used to run Appium: Mac OS (the actual server)
  • Npm or Yarn package manager: Npm , the last version of appium avaible I think since yesterday I used npm install -g appium
  • Real device or emulator/simulator: Real device, Samsung S6 Edge (but the server is never reached)

Details

My Gradle is this: https://pastebin.com/cN3aMczH
With line 27 commented I get the error
java.lang.NoClassDefFoundError: org/openqa/selenium/Capabilities
If I remove comment and let Gradle download selenium the problem becomes
java.lang.NoClassDefFoundError: io/appium/java_client/android/AndroidDriver

The real problem is that both of the classes are in my Project Build, and I can even reach them and read their .class file and reach the source code with Eclipse.

Link to Appium logs

Appium server is never reached, since the bug happens when trying to instantiate an Android Driver.
But I have the Java Stack Trace: https://pastebin.com/fWn4UkFm

Code To Reproduce Issue [ Good To Have ]

https://pastebin.com/1eiD1iSp
Line 20 throws the error.

Am I doing something wrong? I don't have any duplicate jar file in my project path since it's a new project that I just created.
Also is my code right? Should I use android driver, or could I continue using RemoteWebDriver?

With RemoteWebDriver and UiAutomator2 the server doesn't recognize my object even if I am using the right XPath (that with appium 1.6.2 works), without UiAutomator2 it simply sais "UiAutomator stopped" and the app isn't even started.

Thanks for any help

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Gradle dependency setup linked in the issue, especially line 27, then inspect the reproducer at line 20 and the Java stack trace. Compare the resolved Selenium and Appium Java client dependencies and verify whether AndroidDriver can be instantiated without conflicting or missing classes.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile-dev, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.