一直编译好好地项目,运行突然出现错误:
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'
}
本文解决了一个关于Gradle配置文件中程序包org.junit缺失的问题,导致编译正常的应用程序在运行时出现错误。问题源于build.gradle文件内testCompile'junit:junit:4.12'被误删或修改。
1869

被折叠的 条评论
为什么被折叠?



