Getting "java.lang.NoClassDefFoundError: org/openqa/selenium/remote/internal/OkHttpClient$Factory" error


I am using appium latest version 1.8.1,selenium 3.14.0 java client, appium 6.1.0 java client.
bolow is my code to get android driver instance:

AndroidDriver<?> driver;
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.APPIUM_VERSION, “1.8.1”);
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, “K9 Viraat”);
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, “6.0”);
capabilities.setCapability(MobileCapabilityType.PLATFORM, “Android”);
capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());
driver = new AndroidDriver<>(new URL(“”), capabilities);


I had earlier appium 1.4 and corresponding java client. But after updation to 1.8.1 version I am getting error :
“java.lang.NoClassDefFoundError: org/openqa/selenium/remote/internal/OkHttpClient$Factory” error.

I also updated selenium java client to 3.14.0 but it’s not working.

If anyone has experienced this,kindly provide steps to resolve this.



Did you find the solution for this? I am facing the similar issue.

fixed after updating appium java client to last version:
compile group: ‘io.appium’, name: ‘java-client’, version: ‘7.0.0’