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
The solution to this is to add junit library as dependency to the project. This can be done by adding junit to global library and then hovering over the error(junit word) and right clicking to add junit to class path.
you can check if the plugin is installed if it is. it is just matter of adding it to class path you can do it automatically by selecting the junit word and then press on the inspection left side yellow bulb choose "add junit to classpath"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With