When I try to run tests in Android studio when creating an app, I get this error:
/Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home/bin/java -ea -Didea.launcher.port=7533 "-Didea.launcher.bin.path=/Volumes/Android Studio 1.1.0/Android Studio.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath "/Volumes/Android Studio 1.1.0/Android Studio.app/Contents/lib/idea_rt.jar:/Volumes/Android Studio 1.1.0/Android Studio.app/Contents/plugins/junit/lib/junit-rt.jar:/Users/Carl/Library/Android/sdk/platforms/android-21/android.jar:/Users/Carl/Library/Android/sdk/platforms/android-21/data/res:/Users/Carl/AndroidStudioProjects/Sunshine-Version-3/app/build/intermediates/classes/test/debug:/Users/Carl/AndroidStudioProjects/Sunshine-Version-3/app/build/intermediates/classes/debug:/Users/Carl/Library/Android/sdk/extras/android/m2repository/com/android/support/support-annotations/21.0.2/support-annotations-21.0.2.jar:/Users/Carl/AndroidStudioProjects/Sunshine-Version-3/app/build/intermediates/exploded-aar/com.android.support/support-v4/21.0.2/classes.jar:/Users/Carl/AndroidStudioProjects/Sunshine-Version-3/app/build/intermediates/exploded-aar/com.android.support/support-v4/21.0.2/libs/internal_impl-21.0.2.jar:/Users/Carl/AndroidStudioProjects/Sunshine-Version-3/app/build/intermediates/exploded-aar/com.android.support/support-v4/21.0.2/res:/Users/Carl/AndroidStudioProjects/Sunshine-Version-3/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.2/classes.jar:/Users/Carl/AndroidStudioProjects/Sunshine-Version-3/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.2/res" com.intellij.rt.execution.application.AppMain com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 @/private/var/folders/hv/2rmrsk154qn6gb1ph1h7v0pc0000gp/T/idea_junit8537342709436198605.tmp @w@/private/var/folders/hv/2rmrsk154qn6gb1ph1h7v0pc0000gp/T/idea_working_dirs_junit3455533605177330243.tmp -socket50922
Exception in thread "main" java.lang.NoClassDefFoundError: junit/textui/ResultPrinter
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:259)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:116)
Caused by: java.lang.ClassNotFoundException: junit.textui.ResultPrinter
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 3 more
Process finished with exit code 1
I'm following an video which have the same code and gets green(test has been passed) so it should work. I right click here on the "com.example.android.sunshine.app" folder: http://puu.sh/hixoX/2627842974.png and then choose Run tests which do they do in the video, but I still get the error. The only difference in how it looks in the video compared to my Android studio is here: http://puu.sh/hixBg/b65c7e70bf.png where it says "in com.example..". For me it doesn't say "in" there, only "Run tests".
Do anyone know why I get this error? I'm using Android studio: 1.1.0 on mac.
Thanks in advance!
0 comments:
Post a Comment