java-client icon indicating copy to clipboard operation
java-client copied to clipboard

NoSuchMethodError: io.appium.java_client.ios.IOSDriver.substituteMobilePlatform

Open baubakg opened this issue 11 years ago • 3 comments

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.(IOSDriver.java:23) at DragAndDropIOS.testDragAndDrop__Simulator_Paint(DragAndDropIOS.java:685) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84) at org.testng.internal.Invoker.invokeMethod(Invoker.java:714) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111) at org.testng.TestRunner.privateRun(TestRunner.java:767) at org.testng.TestRunner.run(TestRunner.java:617) at org.testng.SuiteRunner.runTest(SuiteRunner.java:334) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291) at org.testng.SuiteRunner.run(SuiteRunner.java:240) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224) at org.testng.TestNG.runSuitesLocally(TestNG.java:1149) at org.testng.TestNG.run(TestNG.java:1057) at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111) at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)

baubakg avatar Feb 10 '15 11:02 baubakg

Sorry, conflicting java-client libraries were in my path.

baubakg avatar Feb 10 '15 16:02 baubakg

Plz tell me how u have resolved this issue. I dont have any conflicting java-client libraries in my path

nawazshaik avatar Mar 09 '15 11:03 nawazshaik

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

baubakg avatar Mar 09 '15 11:03 baubakg