Java-client: Android studio can't build

Created on 23 Oct 2019  Â·  5Comments  Â·  Source: appium/java-client

Duplicate class org.openqa.selenium.SearchContext found in modules java-client-7.2.0.jar (com.github.appium:java-client:7.2.0) and selenium-api-3.141.59.jar (org.seleniumhq.selenium:selenium-api:3.141.59)
Duplicate class org.openqa.selenium.WebDriver found in modules java-client-7.2.0.jar (com.github.appium:java-client:7.2.0) and selenium-api-3.141.59.jar (org.seleniumhq.selenium:selenium-api:3.141.59)
Duplicate class org.openqa.selenium.WebDriver$ImeHandler found in modules java-client-7.2.0.jar (com.github.appium:java-client:7.2.0) and selenium-api-3.141.59.jar (org.seleniumhq.selenium:selenium-api:3.141.59)
Duplicate class org.openqa.selenium.WebDriver$Navigation found in modules java-client-7.2.0.jar (com.github.appium:java-client:7.2.0) and selenium-api-3.141.59.jar (org.seleniumhq.selenium:selenium-api:3.141.59)
Duplicate class org.openqa.selenium.WebDriver$Options found in modules java-client-7.2.0.jar (com.github.appium:java-client:7.2.0) and selenium-api-3.141.59.jar (org.seleniumhq.selenium:selenium-api:3.141.59)
Duplicate class org.openqa.selenium.WebDriver$TargetLocator found in modules java-client-7.2.0.jar (com.github.appium:java-client:7.2.0) and selenium-api-3.141.59.jar (org.seleniumhq.selenium:selenium-api:3.141.59)
Duplicate class org.openqa.selenium.WebDriver$Timeouts found in modules java-client-7.2.0.jar (com.github.appium:java-client:7.2.0) and selenium-api-3.141.59.jar (org.seleniumhq.selenium:selenium-api:3.141.59)
Duplicate class org.openqa.selenium.WebDriver$Window found in modules java-client-7.2.0.jar (com.github.appium:java-client:7.2.0) and selenium-api-3.141.59.jar (org.seleniumhq.selenium:selenium-api:3.141.59)
Duplicate class org.openqa.selenium.WebElement found in modules java-client-7.2.0.jar (com.github.appium:java-client:7.2.0) and selenium-api-3.141.59.jar (org.seleniumhq.selenium:selenium-api:3.141.59)
Duplicate class org.openqa.selenium.internal.FindsByClassName found in modules java-client-7.2.0.jar (com.github.appium:java-client:7.2.0) and selenium-api-3.141.59.jar (org.seleniumhq.selenium:selenium-api:3.141.59)
Duplicate class org.openqa.selenium.internal.FindsByCssSelector found in modules java-client-7.2.0.jar (com.github.appium:java-client:7.2.0) and selenium-api-3.141.59.jar (org.seleniumhq.selenium:selenium-api:3.141.59)
Duplicate class org.openqa.selenium.internal.FindsById found in modules java-client-7.2.0.jar (com.github.appium:java-client:7.2.0) and selenium-api-3.141.59.jar (org.seleniumhq.selenium:selenium-api:3.141.59)
Duplicate class org.openqa.selenium.internal.FindsByLinkText found in modules java-client-7.2.0.jar (com.github.appium:java-client:7.2.0) and selenium-api-3.141.59.jar (org.seleniumhq.selenium:selenium-api:3.141.59)
Duplicate class org.openqa.selenium.internal.FindsByName found in modules java-client-7.2.0.jar (com.github.appium:java-client:7.2.0) and selenium-api-3.141.59.jar (org.seleniumhq.selenium:selenium-api:3.141.59)
Duplicate class org.openqa.selenium.internal.FindsByTagName found in modules java-client-7.2.0.jar (com.github.appium:java-client:7.2.0) and selenium-api-3.141.59.jar (org.seleniumhq.selenium:selenium-api:3.141.59)
Duplicate class org.openqa.selenium.internal.FindsByXPath found in modules java-client-7.2.0.jar (com.github.appium:java-client:7.2.0) and selenium-api-3.141.59.jar (org.seleniumhq.selenium:selenium-api:3.141.59)

Most helpful comment

I got the same issue. Didn't find any solution yet

All 5 comments

gradle config:

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.cmcm.vase.appium"
        minSdkVersion 24
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    implementation 'com.github.appium:java-client:7.2.0'
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
}

anyone has some idea?

I got the same issue. Didn't find any solution yet

i have faced similar issue with Android studio, and even speak with maintainer (Srinivasan) of this library. and found out they do not use android studio or intelli j to test or build this library. so to use this library i made a seperate branch which contains test cases only and sync the gradle only as build is always failed, i even tired excluding some of internal dependencies of this libraries to resolve the conflict but some of selinium and other library are tightly coupled and i guess are base of this library. hence to

fix this issue only sync gradle , --> then start appium server --> then run script directly on terminal

. it worked. also currently using 7.2.0 version as there are some issues are live on 7.3.0 .

@Abhishekgarg727 when you say run script directly on terminal, you mean building the APK and the executing on the device? because it doesn't work either

Was this page helpful?
0 / 5 - 0 ratings