我在AndroidJunit4.class
导入时遇到问题。我在文件夹中创建了测试类,androidTest/java/
但似乎找不到该类。
即使我强制正确导入它仍然不起作用。( import android.support.test
)。
@RunWith(AndroidJunit4.class)
public class RandomTest {
}
这是我的毕业典礼:
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
在我的项目中找到文件,但是在它的 parent中,即使我也可以在我的项目中找到文件AndroidJunit4ClassRunner
,类也没有解析。AndroidRunnerParams