0

After setting up gradle properly, when i add for example @RunWith(RobolectricTestRunner::class) at the top of my test class, Andtoid studio does not import the class automatically when I click Alt+Enter.

When I manually type import org.robolectric.RobolectricTestRunner, i see that the class is recognized.

I have already done Invalidate Caches/Restart...

I am using Kotlin and AndroidStudio 4.0 and robolectric:4.3.1.

nyxee
  • 2,773
  • 26
  • 22

1 Answers1

2

I had to use

androidTestImplementation 'org.robolectric:robolectric:4.3.1'

instead of

testImplementation 'org.robolectric:robolectric:4.3.1'

i my module build.gradle.

nyxee
  • 2,773
  • 26
  • 22