2

It's hard to describe without an image:

Edit: (I can't post an image till I have more reputation).

The jar exists in External Libraries, and the package contains the class ('org.robolectric.AndroidManifest'). The import statement is grey up till the word 'robolectric', but is red on 'AndroidManifest'. When I click into the package (robolectric), it takes me to the correct package, which apparently contains the class.

This is the only Robolectric library in the application, so it isn't a case of looking at one library while using another.

It's similar to this issue, but the solution didn't work.

I've cleaned, rebuilt, reindexed.

Community
  • 1
  • 1
Yervant
  • 225
  • 2
  • 8

1 Answers1

1

The solution I found simply involved turning all the 'testCompile' in gradle.build into 'compile'. I don't know why this works.

Yervant
  • 225
  • 2
  • 8
  • 3
    Be careful - do not include robolectric in the application itself. Everything that stated as `compile` dependency will be included to apk – Eugen Martynov Feb 12 '15 at 18:56
  • In order to avoid the regular Robolectric/gradle problems we run Robolectric in a separate module, instead of as a test config on the main module. – Yervant Feb 17 '15 at 00:34