2017-10-21 15 views
2

ビルドにIntellij Community Edition with Gradleを使用しています。自分のGradleの依存関係にあるAppiumをインポートできないのはなぜですか?

は、ここに私の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>" 
} 

私はIOからappiumのもののいずれかをインポートをしよう

。 Intellijはそこにないと言います。外部の図書館には見知らぬ人でさえ、数多くのGradle:ライブラリがありますが、Appiumのライブラリはありません。

私はAppiumがライブラリではないと思いますが、私はcomplieとtestCompileの両方を試しましたが、いずれもappiumの名前空間をインポートできません。

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

これらは、srcとtestの両方のフォルダに見つかりません。一方、私はキュウリを問題なく輸入することができます。

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

上記の2つの作業とintellijがコンパイルされます。

答えて

3

私はこのテストでdependencyを使用しています。正常に動作します。以下を試してみてください。同様にdependency

dependencies{ 
    // https://mvnrepository.com/artifact/io.appium/java-client 
    compile group: 'io.appium', name: 'java-client', version: '5.0.4' 
} 
+0

あなたはbuild.gradleをクリックする意味それを実行しますか? – liminal18

+0

うん。 「gradleプロジェクトをインポートする必要がある」という通知を受け取っている場合は、[Import Changes]を選択してください。 –

+0

Okを試してみましょう – liminal18

1

を変更した後、プロジェクトあなたrebuildていることを確認し、あなたがandroidTestでテストを持っている場合、あなたはこのようにインポートすることができます実行することにより

androidTestImplementation 'io.appium:java-client:5.0.4' 
関連する問題