1
AndroidJunit4.classインポートに問題があります。 androidTest/java/folderにテストクラスを作成しましたが、クラスが見つからないようです。AndroidJUnit4.classが計装テストで見つかりません
私は正しいインポートを強制しても、それはまだ動作しません。 (import android.support.test。*)。ここで
@RunWith(AndroidJunit4.class)
public class RandomTest {
}
は私のGradleです:
defaultConfig {
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
dependencies {
compile "com.android.support:support-annotations:23.4.0"
compile "com.android.support:appcompat-v7:23.4.0"
compile 'cat.ereza:customactivityoncrash:1.5.0'
testCompile 'junit:junit:4.12'
androidTestCompile 'junit:junit:4.12'
androidTestCompile('com.android.support.test:runner:0.5')
androidTestCompile('com.android.support.test:rules:0.5')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2')
androidTestCompile('com.android.support.test.espresso:espresso-contrib:2.2.2')
androidTestCompile('com.android.support.test.espresso:espresso-intents:2.2.2')
testCompile('com.android.support.test:runner:0.5')
testCompile('com.android.support.test:rules:0.5')
testCompile('com.android.support.test.espresso:espresso-core:2.2.2')
testCompile('com.android.support.test.espresso:espresso-contrib:2.2.2')
testCompile('com.android.support.test.espresso:espresso-intents:2.2.2')
testCompile 'org.mockito:mockito-core:1.10.19'
testCompile "org.robolectric:robolectric:3.1.1"
}
奇妙なことは、私は私のプロジェクトでAndroidJunit4ファイルを見つけることができるということですが、私もできれば、その親(AndroidJunit4ClassRunner)で、AndroidRunnerParamsクラスであっても解決されません私のプロジェクトでファイルを見つける。
また、「testInstrumentationRunner」android.support.test.runner.AndroidJUnitRunnerを追加していますか? "' defaultConfigの下にありますか? – Egor
はい私もそれを加えました、私はそれに気付かなかった上記。 – rct29