Java – why can’t I import appium if it’s in my gradle dependency?

I'm building with IntelliJ Community Edition with gradle

This is my build gradle deps:

dependencies {
    testCompile group: 'junit',name: 'junit',version: '4.+'
    testCompile 'info.cukes:cucumber-java:1.2.4','info.cukes:cucumber-junit:1.2.4'
    classpath 'com.android.tools.build:gradle:1.3.0'
    classpath 'com.amazonaws:aws-devicefarm-gradle-plugin:1.2'
    compile 'io.appium:java-client:4.0.0'
    classpath "io.qaMeta.allure:allure-gradle:<latest>"
}

When I try to import anything appium from Io IntelliJ says it doesn't exist In WY external libraries, it is even more strange that there are many gradles: libraries, but there is no appium library

I don't think appium is a library, but I've tried compound and testcompile, and I can't import any appium namespace

import io.appium.java_client.functions.AppiumFunction;
import org.openqa.selenium.support.ui.ExpectedCondition;

These are not found in my SRC and test folders On the other hand, I can import cucumbers, no problem

import cucumber.api.junit.Cucumber;
import org.junit.runner.RunWith;

The above 2 work and IntelliJ will be compiled with them

Solution

I use this dependency in my tests and it works You can try the following Ensure that the project is rebuilt after changing dependencies

dependencies{
  // https://mvnrepository.com/artifact/io.appium/java-client
  compile group: 'io.appium',name: 'java-client',version: '5.0.4'
}
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>