Getting a java.lang.NoClassDefFoundError: io.appium.java_client.AppiumDriver

Hi,

I am new to Appium and just setup the required dependencies.I am trying to open the contact manager in the real android device and add a contact.
I am using Android Studio 2.2
and java version jdk1.8.0_40

However, I get the below error:
java.lang.NoClassDefFoundError: io.appium.java_client.AppiumDriver

Please find below my code for Android Studio Project:

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.MobileElement;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.AndroidElement;
import io.appium.java_client.remote.MobileCapabilityType;
import org.junit.After;
import org.junit.Before;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.List;

/**
 * Instrumentation test, which will execute on an Android device.
 *
 * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
 */

@RunWith(AndroidJUnit4.class)
public class TestingContact {
static AppiumDriver<AndroidElement> driver;

@BeforeClass
public void setUp() throws MalformedURLException {
    // set up appium

 
 DesiredCapabilities capabilities = new DesiredCapabilities();
   capabilities.setCapability(MobileCapabilityType.DEVICE_NAME,"AB1C22DE5F");
        capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "5.1.1");
        capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());
        capabilities.setCapability("appPackage", "com.example.android.contactmanager");
        capabilities.setCapability("appActivity", ".ContactManager");

        driver = new AndroidDriver<>(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
     }



    @Test
    public void addContact(){
        WebElement el = driver.findElement(By.xpath(".//*[@text='Add Contact']"));
        el.click();
        List<AndroidElement> textFieldsList = driver.findElementsByClassName("android.widget.EditText");

        textFieldsList.get(0).sendKeys("Test Name");
        textFieldsList.get(2).sendKeys("[email protected]");
        driver.swipe(100, 500, 100, 100, 2);
        driver.findElementByXPath(".//*[@text='Save']").click();

    }

    @AfterClass
    public void tearDown() throws Exception {
        driver.quit();
    }
}

gradle file for my app

apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.2"
    defaultConfig {
        applicationId "com.example.[swathianand.addcontactmanager"
        minSdkVersion 15
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
       multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    dexOptions{

        javaMaxHeapSize "4g"
    }


    packagingOptions {
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/dependencies.txt'
        exclude 'META-INF/LGPL2.1'
    }
}

dependencies {
    //compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:24.2.1'
    androidTestCompile 'junit:junit:4.12'
     provided ('io.appium:java-client:4.1.2',{
        exclude module: 'guava'
        exclude module: 'httpmime'
        exclude module: 'gson'
    })
}

Project level build gradle

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Ran using Android Studio Debugger o/p

java.lang.NoClassDefFoundError: io.appium.java_client.AppiumDriver
                  at libcore.reflect.InternalNames.getClass(InternalNames.java:55)
                  at java.lang.Class.getDexCacheType(Class.java:479)
                  at java.lang.reflect.ArtField.getType(ArtField.java:94)
                  at java.lang.reflect.Field.getType(Field.java:135)
                  at java.lang.Class.getDeclaredFields(Class.java:912)
                  at org.junit.runners.model.TestClass.getSortedDeclaredFields(TestClass.java:77)
                  at org.junit.runners.model.TestClass.scanAnnotatedMembers(TestClass.java:70)
                  at org.junit.runners.model.TestClass.<init>(TestClass.java:57)
                  at org.junit.runners.ParentRunner.createTestClass(ParentRunner.java:88)
                  at org.junit.runners.ParentRunner.<init>(ParentRunner.java:83)
                  at org.junit.runners.BlockJUnit4ClassRunner.<init>(BlockJUnit4ClassRunner.java:65)
                  at android.support.test.internal.runner.junit4.AndroidJUnit4ClassRunner.<init>(AndroidJUnit4ClassRunner.java:37)
                  at android.support.test.runner.AndroidJUnit4.<init>(AndroidJUnit4.java:36)
                  at java.lang.reflect.Constructor.newInstance(Native Method)
                  at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
                  at android.support.test.internal.runner.junit4.AndroidAnnotatedBuilder.buildAndroidRunner(AndroidAnnotatedBuilder.java:83)
                  at android.support.test.internal.runner.junit4.AndroidAnnotatedBuilder.runnerForClass(AndroidAnnotatedBuilder.java:62)
                  at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
                  at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
                  at org.junit.runner.Computer.getRunner(Computer.java:40)
                  at org.junit.runner.Computer$1.runnerForClass(Computer.java:31)
                  at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
                  at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:101)
                  at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:87)
                  at org.junit.runners.Suite.<init>(Suite.java:81)
                  at org.junit.runner.Computer.getSuite(Computer.java:28)
                  at android.support.test.internal.runner.TestRequestBuilder.classes(TestRequestBuilder.java:789)
                  at android.support.test.internal.runner.TestRequestBuilder.build(TestRequestBuilder.java:753)
                  at android.support.test.runner.AndroidJUnitRunner.buildRequest(AndroidJUnitRunner.java:354)
                  at android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:260)
                  at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1853)
               Caused by: java.lang.ClassNotFoundException: Didn't find class "io.appium.java_client.AppiumDriver" on path: DexPathList[[zip file "/system/framework/android.test.runner.jar", zip file "/data/app/com.example.swathianand.addcontactmanager.test-2/base.apk", zip file "/data/app/com.example.swathianand.addcontactmanager-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
                  at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
                  at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
                  at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
                  at libcore.reflect.InternalNames.getClass(InternalNames.java:53)
                  at java.lang.Class.getDexCacheType(Class.java:479) 
                  at java.lang.reflect.ArtField.getType(ArtField.java:94) 
                  at java.lang.reflect.Field.getType(Field.java:135) 
                  at java.lang.Class.getDeclaredFields(Class.java:912) 
                  at org.junit.runners.model.TestClass.getSortedDeclaredFields(TestClass.java:77) 
                  at org.junit.runners.model.TestClass.scanAnnotatedMembers(TestClass.java:70) 
                  at org.junit.runners.model.TestClass.<init>(TestClass.java:57) 
                  at org.junit.runners.ParentRunner.createTestClass(ParentRunner.java:88) 
                  at org.junit.runners.ParentRunner.<init>(ParentRunner.java:83) 
                  at org.junit.runners.BlockJUnit4ClassRunner.<init>(BlockJUnit4ClassRunner.java:65) 
                  at android.support.test.internal.runner.junit4.AndroidJUnit4ClassRunner.<init>(AndroidJUnit4ClassRunner.java:37) 
                  at android.support.test.runner.AndroidJUnit4.<init>(AndroidJUnit4.java:36) 
                  at java.lang.reflect.Constructor.newInstance(Native Method) 
                  at java.lang.reflect.Constructor.newInstance(Constructor.java:288) 
                  at android.support.test.internal.runner.junit4.AndroidAnnotatedBuilder.buildAndroidRunner(AndroidAnnotatedBuilder.java:83) 
                  at android.support.test.internal.runner.junit4.AndroidAnnotatedBuilder.runnerForClass(AndroidAnnotatedBuilder.java:62) 
                  at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) 
                  at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26) 
                  at org.junit.runner.Computer.getRunner(Computer.java:40) 
                  at org.junit.runner.Computer$1.runnerForClass(Computer.java:31) 
                  at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) 
                  at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:101) 
                  at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:87) 
                  at org.junit.runners.Suite.<init>(Suite.java:81) 
                  at org.junit.runner.Computer.getSuite(Computer.java:28) 
                  at android.support.test.internal.runner.TestRequestBuilder.classes(TestRequestBuilder.java:789) 
                  at android.support.test.internal.runner.TestRequestBuilder.build(TestRequestBuilder.java:753) 
                  at android.support.test.runner.AndroidJUnitRunner.buildRequest(AndroidJUnitRunner.java:354) 
                  at android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:260) 
                  at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1853) 
              	Suppressed: java.lang.ClassNotFoundException: io.appium.java_client.AppiumDriver
                  at java.lang.Class.classForName(Native Method)
                  at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
                  at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
                  at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
                  		... 32 more
               Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
I/TestRunner: ----- end exception -----
I/TestRunner: finished: initializationError(com.example.swathianand.addcontactmanager.TestingContact)
I/MonitoringInstrumentation: Activities that are still in CREATED to STOPPED: 0
I/TestRunner: run finished: 1 tests, 1 failed, 0 ignored
I/MonitoringInstrumentation: Activities that are still in CREATED to STOPPED: 0
I/MonitoringInstrumentation: waitForActivitiesToComplete() took: 0msTests ran to completion.


Disconnected from the target VM, address: 'localhost:8604', transport: 'socket'

Run console

Testing started at 12:57 AM ...

09/24 00:57:05: Launching TestingContact
No apk changes detected since last installation, skipping installation of C:\[spoiler]swathi[/spoiler]\AddContactManager\app\build\outputs\apk\app-debug.apk
$ adb shell am force-stop com.example.swathianand.addcontactmanager
No apk changes detected since last installation, skipping installation of C:\swathi\AddContactManager\app\build\outputs\apk\app-debug-androidTest.apk
$ adb shell am force-stop com.example.swathianand.addcontactmanager.test
Running tests

$ adb shell am instrument -w -r   -e debug false -e class com.example.swathianand.addcontactmanager.TestingContact com.example.swathianand.addcontactmanager.test/android.support.test.runner.AndroidJUnitRunner
Client not ready yet..
Started running tests

java.lang.NoClassDefFoundError: io.appium.java_client.AppiumDriver
at libcore.reflect.InternalNames.getClass(InternalNames.java:55)
at java.lang.Class.getDexCacheType(Class.java:479)
at java.lang.reflect.ArtField.getType(ArtField.java:94)
at java.lang.reflect.Field.getType(Field.java:135)
at java.lang.Class.getDeclaredFields(Class.java:912)
at org.junit.runners.model.TestClass.getSortedDeclaredFields(TestClass.java:77)
at org.junit.runners.model.TestClass.scanAnnotatedMembers(TestClass.java:70)
at org.junit.runners.model.TestClass.<init>(TestClass.java:57)
at org.junit.runners.ParentRunner.createTestClass(ParentRunner.java:88)
at org.junit.runners.ParentRunner.<init>(ParentRunner.java:83)
at org.junit.runners.BlockJUnit4ClassRunner.<init>(BlockJUnit4ClassRunner.java:65)
at android.support.test.internal.runner.junit4.AndroidJUnit4ClassRunner.<init>(AndroidJUnit4ClassRunner.java:37)
at android.support.test.runner.AndroidJUnit4.<init>(AndroidJUnit4.java:36)
at java.lang.reflect.Constructor.newInstance(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
at android.support.test.internal.runner.junit4.AndroidAnnotatedBuilder.buildAndroidRunner(AndroidAnnotatedBuilder.java:83)
at android.support.test.internal.runner.junit4.AndroidAnnotatedBuilder.runnerForClass(AndroidAnnotatedBuilder.java:62)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
at org.junit.runner.Computer.getRunner(Computer.java:40)
at org.junit.runner.Computer$1.runnerForClass(Computer.java:31)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:101)
at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:87)
at org.junit.runners.Suite.<init>(Suite.java:81)
at org.junit.runner.Computer.getSuite(Computer.java:28)
at android.support.test.internal.runner.TestRequestBuilder.classes(TestRequestBuilder.java:789)
at android.support.test.internal.runner.TestRequestBuilder.build(TestRequestBuilder.java:753)
at android.support.test.runner.AndroidJUnitRunner.buildRequest(AndroidJUnitRunner.java:354)
at android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:260)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1853)
Caused by: java.lang.ClassNotFoundException: Didn't find class "io.appium.java_client.AppiumDriver" on path: DexPathList[[zip file "/system/framework/android.test.runner.jar", zip file "/data/app/com.example.swathianand.addcontactmanager.test-2/base.apk", zip file "/data/app/com.example.swathianand.addcontactmanager-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at libcore.reflect.InternalNames.getClass(InternalNames.java:53)
... 30 more
Suppressed: java.lang.ClassNotFoundException: io.appium.java_client.AppiumDriver
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 32 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

Tests ran to completion.

Gradle Console o/p

Executing tasks: [:app:assembleDebug, :app:assembleDebugAndroidTest]

Configuration on demand is an incubating feature.
WARNING: WARNING: Dependency org.apache.httpcomponents:httpclient:4.5.2 is ignored for debug as it may be conflicting with the internal version provided by Android.
         In case of problem, please repackage it with jarjar to change the class packages
WARNING: WARNING: Dependency org.apache.httpcomponents:httpclient:4.5.2 is ignored for debug as it may be conflicting with the internal version provided by Android.
         In case of problem, please repackage it with jarjar to change the class packages
WARNING: WARNING: Dependency commons-logging:commons-logging:1.2 is ignored for debug as it may be conflicting with the internal version provided by Android.
         In case of problem, please repackage it with jarjar to change the class packages
WARNING: WARNING: Dependency org.apache.httpcomponents:httpclient:4.5.2 is ignored for debug as it may be conflicting with the internal version provided by Android.
         In case of problem, please repackage it with jarjar to change the class packages
WARNING: WARNING: Dependency commons-logging:commons-logging:1.2 is ignored for debug as it may be conflicting with the internal version provided by Android.
         In case of problem, please repackage it with jarjar to change the class packages
WARNING: WARNING: Dependency commons-logging:commons-logging:1.2 is ignored for debug as it may be conflicting with the internal version provided by Android.
         In case of problem, please repackage it with jarjar to change the class packages
WARNING: WARNING: Dependency commons-logging:commons-logging:1.2 is ignored for debug as it may be conflicting with the internal version provided by Android.
         In case of problem, please repackage it with jarjar to change the class packages
WARNING: WARNING: Dependency org.apache.httpcomponents:httpclient:4.5.2 is ignored for release as it may be conflicting with the internal version provided by Android.
         In case of problem, please repackage it with jarjar to change the class packages
WARNING: WARNING: Dependency org.apache.httpcomponents:httpclient:4.5.2 is ignored for release as it may be conflicting with the internal version provided by Android.
         In case of problem, please repackage it with jarjar to change the class packages
WARNING: WARNING: Dependency commons-logging:commons-logging:1.2 is ignored for release as it may be conflicting with the internal version provided by Android.
         In case of problem, please repackage it with jarjar to change the class packages
WARNING: WARNING: Dependency org.apache.httpcomponents:httpclient:4.5.2 is ignored for release as it may be conflicting with the internal version provided by Android.
         In case of problem, please repackage it with jarjar to change the class packages
WARNING: WARNING: Dependency commons-logging:commons-logging:1.2 is ignored for release as it may be conflicting with the internal version provided by Android.
         In case of problem, please repackage it with jarjar to change the class packages
WARNING: WARNING: Dependency commons-logging:commons-logging:1.2 is ignored for release as it may be conflicting with the internal version provided by Android.
         In case of problem, please repackage it with jarjar to change the class packages
WARNING: WARNING: Dependency commons-logging:commons-logging:1.2 is ignored for release as it may be conflicting with the internal version provided by Android.
         In case of problem, please repackage it with jarjar to change the class packages
Incremental java compilation is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2421Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72421Library UP-TO-DATE
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:prepareComAndroidSupportMultidex101Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCompat2421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCoreUi2421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCoreUtils2421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportFragment2421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportMediaCompat2421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportVectorDrawable2421Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:app:compileDebugJavaWithJavac UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources UP-TO-DATE
:app:mergeDebugShaders UP-TO-DATE
:app:compileDebugShaders UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:transformClassesWithJarMergingForDebug UP-TO-DATE
:app:transformClassesWithMultidexlistForDebug UP-TO-DATE
:app:transformClassesWithDexForDebug UP-TO-DATE
:app:mergeDebugJniLibFolders UP-TO-DATE
:app:transformNative_libsWithMergeJniLibsForDebug UP-TO-DATE
:app:processDebugJavaRes UP-TO-DATE
:app:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
:app:validateSigningDebug
:app:packageDebug UP-TO-DATE
:app:assembleDebug UP-TO-DATE
:app:prepareComAndroidSupportMultidexInstrumentation101Library UP-TO-DATE
:app:prepareComAndroidSupportTestEspressoEspressoCore222Library UP-TO-DATE
:app:prepareComAndroidSupportTestEspressoEspressoIdlingResource222Library UP-TO-DATE
:app:prepareComAndroidSupportTestExposedInstrumentationApiPublish05Library UP-TO-DATE
:app:prepareComAndroidSupportTestRules05Library UP-TO-DATE
:app:prepareComAndroidSupportTestRunner05Library UP-TO-DATE
:app:prepareDebugAndroidTestDependencies
:app:compileDebugAndroidTestAidl UP-TO-DATE
:app:processDebugAndroidTestManifest UP-TO-DATE
:app:compileDebugAndroidTestRenderscript UP-TO-DATE
:app:generateDebugAndroidTestBuildConfig UP-TO-DATE
:app:generateDebugAndroidTestResValues UP-TO-DATE
:app:generateDebugAndroidTestResources UP-TO-DATE
:app:mergeDebugAndroidTestResources UP-TO-DATE
:app:processDebugAndroidTestResources UP-TO-DATE
:app:generateDebugAndroidTestSources UP-TO-DATE
:app:incrementalDebugAndroidTestJavaCompilationSafeguard UP-TO-DATE
:app:compileDebugAndroidTestJavaWithJavac UP-TO-DATE
:app:compileDebugAndroidTestNdk UP-TO-DATE
:app:compileDebugAndroidTestSources UP-TO-DATE
:app:mergeDebugAndroidTestShaders UP-TO-DATE
:app:compileDebugAndroidTestShaders UP-TO-DATE
:app:generateDebugAndroidTestAssets UP-TO-DATE
:app:mergeDebugAndroidTestAssets UP-TO-DATE
:app:transformClassesWithJarMergingForDebugAndroidTest UP-TO-DATE
:app:transformClassesWithMultidexlistForDebugAndroidTest UP-TO-DATE
:app:transformClassesWithDexForDebugAndroidTest UP-TO-DATE
:app:mergeDebugAndroidTestJniLibFolders UP-TO-DATE
:app:transformNative_libsWithMergeJniLibsForDebugAndroidTest UP-TO-DATE
:app:processDebugAndroidTestJavaRes UP-TO-DATE
:app:transformResourcesWithMergeJavaResForDebugAndroidTest UP-TO-DATE
:app:validateSigningDebugAndroidTest
:app:packageDebugAndroidTest UP-TO-DATE
:app:assembleDebugAndroidTest UP-TO-DATE

BUILD SUCCESSFUL

Total time: 0.887 secs
  • I have tried various combinations by just adding the java-client-4.1.2 directly to the app libs folder and running but end with same error.Also tried including the java-client-4.1.2 and the selenium-2.53.1 in libs.Nothing helped so far.Excluding or including of guava, gson, playservices,commons_validators and the httpmime did not help either.

  • I started the appium using the installer for windows.
    Not sure if I am missing anything or is there any compatibility issues.

  • I have also tried AndroidDriver instead of AppiumDriver but still hit same error.

Did you add java_client into your project or include it into Maven dependencies pom.xml?

I added the java_client using maven provided by android studio .Android studio has the grade file for app and project level.I included at app level just shown in the above code for gradle file for my app code

I haven’t used Android Studio as a IDE. From above error it seems there was something wrong with the java_client. May other people can help.

https://mvnrepository.com/artifact/org.apache.commons/commons-lang3/3.7

Please download the Apache Jar file from given link and attach in your library fro Appium project.

1 Like

The same Issue faced while executing the Appium script.

https://mvnrepository.com/artifact/org.apache.commons/commons-lang3/3.7

Please download the Apache Jar file from given link and attach in your library fro Appium project.

1 Like