本文介绍了线程“main"中的异常java.lang.NoClassDefFoundError: junit/textui/ResultPrinter的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试在 Android Studio 0.3.0 中编译我的 Android 项目.今天我收到以下错误:
I'm trying to compile my Android project in Android Studio 0.3.0. Today I get the following error:
Exception in thread "main" java.lang.NoClassDefFoundError: junit/textui/ResultPrinter
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:188)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:113)
Caused by: java.lang.ClassNotFoundException: junit.textui.ResultPrinter
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
... 3 more
Process finished with exit code 1
进行一些网络搜索让我相信这个问题与 JUnit 有某种关系.但是,我没有在我的项目中使用 JUnit.也许我无意中打开了某个选项?在这种情况下,如何在我的项目中禁用单元测试?有任何想法吗?
Doing some web searches leads me to believe this issue is somehow related to JUnit. However, I'm not using JUnit in my project. Maybe I've inadvertently turned on some option? In that case, how do I disable unit testing in my project? Any ideas?
推荐答案
终于找到了.它位于运行/调试配置"对话框中.禁用 JUnit 并重新编译.
Finally found it. It's in the Run/Debug Configurations dialog. Disabled JUnit and it compiles again.
这篇关于线程“main"中的异常java.lang.NoClassDefFoundError: junit/textui/ResultPrinter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!