nyxee
nyxee

Reputation: 2811

AndroidStudio not automatically importing RoboLectric objects

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.

Upvotes: 0

Views: 457

Answers (1)

nyxee
nyxee

Reputation: 2811

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.

Upvotes: 2

Related Questions