Error:(3, 17) 错误: 程序包org.junit不存在

一直编译好好地项目,运行突然出现错误:

Error:(3, 17) 错误: 程序包org.junit不存在


原因是build.gradle中

testCompile 'junit:junit:4.12'

被误删或者修改了,改回来就可以了。

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:25.1.1'
    testCompile 'junit:junit:4.12'
}

猜你喜欢

转载自blog.csdn.net/Nobody_else_/article/details/80279069