Reputation: 752
When running my robolectric tests in IntelliJ I get:
Warning: an error occurred while binding shadow class: ShadowGeoPoint
Warning: an error occurred while binding shadow class: ShadowItemizedOverlay
Warning: an error occurred while binding shadow class: ShadowMapController
Warning: an error occurred while binding shadow class: ShadowMapActivity
Warning: an error occurred while binding shadow class: ShadowMapView
Warning: an error occurred while binding shadow class: ShadowOverlayItem
WARNING: Unable to find path to Android SDK
java.lang.RuntimeException: java.lang.NullPointerException
at com.xtremelabs.robolectric.res.ResourceLoader.init(ResourceLoader.java:158)
at com.xtremelabs.robolectric.res.ResourceLoader.setLayoutQualifierSearchPath(ResourceLoader.java:599)
at com.xtremelabs.robolectric.RobolectricTestRunner.setupApplicationState(RobolectricTestRunner.java:367)
at com.xtremelabs.robolectric.RobolectricTestRunner.internalBeforeTest(RobolectricTestRunner.java:311)
at com.xtremelabs.robolectric.RobolectricTestRunner.methodBlock(RobolectricTestRunner.java:278)
at ...
The ANDROID_HOME ist set but InteliJ does not seem to find it.
Upvotes: 1
Views: 921
Reputation: 1041
Note : You can add this in the JUnit default settings, so that you don't have to do for each test class
Upvotes: 0
Reputation: 16450
Set the sdk.dir
in a local.properties
file by running the following in your project’s root dir:
$ android update project -p .
Setting up a local.properties
file is a solution that will work for most IDEs since you don’t need to worry about getting environment variables passed around.
I got this from Unable to find Android SDK
. There are also few other options which you may try.
Upvotes: 2