NoSuchMethodError: io.appium.java_client.ios.IOSDriver.substituteMobilePlatform
Hi,
Am testing the java-client 2.1. I am having problems instantiating the IOSDriver. Whenever I instatiate I get the error:
java.lang.NoSuchMethodError: io.appium.java_client.ios.IOSDriver.substituteMobilePlatform(Lorg/openqa/selenium/Capabilities;Ljava/lang/String;)Lorg/openqa/selenium/Capabilities;
Here is my code:
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setPlatform(Platform.valueOf("MAC"));
capabilities.setBrowserName("iPad");
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "iOS");
capabilities
.setCapability(MobileCapabilityType.PLATFORM_VERSION, "8.1");
// capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, "Safari");
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME,
"iPad Retina");
capabilities.setJavascriptEnabled(true);
IOSDriver driver = new IOSDriver(fetchAppiumDirectUrl(), capabilities);
I am using :
- java-client 2.1.0
- Appium 1.3.4
- Selenium server standalone 2.44
I get the NoSuchMethodError when I instantiate the driver.
Here is the full error:
java.lang.NoSuchMethodError: io.appium.java_client.ios.IOSDriver.substituteMobilePlatform(Lorg/openqa/selenium/Capabilities;Ljava/lang/String;)Lorg/openqa/selenium/Capabilities;
at io.appium.java_client.ios.IOSDriver.
Sorry, conflicting java-client libraries were in my path.
Plz tell me how u have resolved this issue. I dont have any conflicting java-client libraries in my path
In my case I was referencing the classes of a secondary project. The references in that project were pointing to a conflicting java-client version.
In Eclipse looking at the Project properties->Java Build Path ->Order and Export clarified the problem for me.
Hope this helps