0

I'm developing a very simple android application. At the stage where I am it's basically all about touching textviews that will start activities. I'm getting this 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:171)
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:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 3 more

From what I can understand it looks like some classes are missing in the junit lib. How can I fix it? I'm not using JUnit, or at least I don't how and where I'm using it, so I don't knwo where to start. Thanks for helping

EDIT: So what you're suggesting is to update JUnit... How? Going to the plugins window it says nothing about the version (though it says that I'm able to run JUnit 3.x and 4.x) and it doesn't let me to update it in anyway.In one of the question that you linked the guy fixed the problem disabling JUnit. I don't really want to follow this drastic solution but even if I would there is no option in the run configuration to do it. I'm using the latest version of Android Studio. Thanks again

EDIT 2: Ok now I tried to download the latest version for junit.org and put it in the classpath but it still doesn't work.. I tried with 4.11,3.8 and 3.7 version.

0 Answers0