Can't run android suite

Hello.

I’ve got two suites written in java code, one for a IOS simulator and one for a android emulator.
I’ve managed to make both suites start the appium node server programmatically and start the IOS one with mvn test command etc.
My problem is I can’t run my android suite because I get this error.
java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;I)V

at org.openqa.selenium.remote.service.DriverService$Builder.usingPort(DriverService.java:241)
at io.appium.java_client.service.local.AppiumServiceBuilder.usingPort(AppiumServiceBuilder.java:455)
at io.appium.java_client.service.local.AppiumServiceBuilder.<init>(AppiumServiceBuilder.java:95)
at appModules.baseClass.setUp(baseClass.java:38)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:523)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:224)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:146)
at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:166)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:105)
at org.testng.TestRunner.privateRun(TestRunner.java:744)
at org.testng.TestRunner.run(TestRunner.java:602)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:380)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
at org.testng.SuiteRunner.run(SuiteRunner.java:289)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1226)
at org.testng.TestNG.runSuites(TestNG.java:1144)
at org.testng.TestNG.run(TestNG.java:1115)
at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72)
at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:127)

I have basically copied all dependencies and pom.xml filed used by the IOS suite (the suite actually working) but I still can’t make it work, all my searching for this issue has basically pointed me at updating the guava dependency to the latest, which I’ve done.
Anyone have a clue how to fix this issue? Appreciate all help given.

v1.6.5 appium node
3.3.1 selenium server standalone
appium java client 5.0.0-BETA9

@rickesnick try to add:

        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>21.0</version>
        </dependency>

or later 22.0+

Thanks for the quick reply. I already have this dependency in my pom.xml… No idea what I’m missing here…

My pom is looking like this

<?xml version="1.0" encoding="UTF-8"?>


4.0.0

<groupId>se.collector.uiTestBetalkoll</groupId>
<artifactId>Android</artifactId>
<version>1.0-SNAPSHOT</version>

<dependencies>

    <!-- https://mvnrepository.com/artifact/io.appium/java-client -->
    <dependency>
        <groupId>io.appium</groupId>
        <artifactId>java-client</artifactId>
        <version>5.0.0-BETA9</version>
    </dependency>

    <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>6.11</version>
    </dependency>



    <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>21.0</version>
    </dependency>






</dependencies>


<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.20</version>
            <configuration>
                <suiteXmlFiles>
                    <!-- Need to pass runAllTests.xml files as parameters from command line -->
                    <suiteXmlFile>runAllTests.xml</suiteXmlFile>
                </suiteXmlFiles>
            </configuration>
        </plugin>

    </plugins>
</build>

@rickesnick
your issue - https://github.com/SeleniumHQ/selenium/issues/3880

i have quite similar with minor changes:

    <build>
        <testSourceDirectory>src/test/java</testSourceDirectory>
        <outputDirectory>/tmp/logs</outputDirectory>
        <resources>
            <resource>
                <directory>src/test/java/resources</directory>
            </resource>
        </resources>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.19.1</version> <!-- 2.19.1 -->
                    <configuration>
                        <suiteXmlFiles>
                            <!-- Suite file injection parameter from command line -->
                            <suiteXmlFile>${suiteXmlFile}</suiteXmlFile>
                        </suiteXmlFiles>
                        <systemPropertyVariables>
                            ..... ///removed
                        </systemPropertyVariables>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.6.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

My god… I solved it. I navigated to my /Users/richardhansson/.m2/repository/com/google/guava/guava/ folder and I found 4 different versions. I deleted them all except the 21.0 version and now its working.
Thanks for your help Aleksei, you are one of the users here making appium forum great