androidintellij-idea

Error:(3, 17) java: package org.junit does not exist- intellij


I recently started using IntelliJ to build my android application project. I imported my sherlock library as a module and added the dependency to my project. However when I try to rebuild my project to check any errors I get a lines of 10 errors like this:

Error:(3, 17) java: package org.junit does not exist
Error:(4, 24) java: package org.junit.runner does not exist
Error:(5, 23) java: package org.robolectric does not exist
Error:(7, 38) java: package org.fest.assertions.api does not exist
Error:(7, 1) java: static import only from classes and interfaces
Error:(9, 2) java: cannot find symbol
  symbol: class RunWith
Error:(11, 6) java: cannot find symbol
  symbol:   class Test
  location: class com.actionbarsherlock.internal.ResourcesCompatTest
Error:(13, 20) java: cannot find symbol
  symbol:   method cleanActivityName(java.lang.String,java.lang.String)
  location: class com.actionbarsherlock.internal.ResourcesCompatTest
Error:(15, 20) java: cannot find symbol
  symbol:   method cleanActivityName(java.lang.String,java.lang.String)
  location: class com.actionbarsherlock.internal.ResourcesCompatTest
Error:(17, 19) java: cannot find symbol
  symbol:   method cleanActivityName(java.lang.String,java.lang.String)
  location: class com.actionbarsherlock.internal.ResourcesCompatTest

Solution

  • looks like the junit.jar is missing in your classpath. Add it and it should work.