I am migrating my app to androidx, I can\'t seem to get my unit tests working. I took example from Google\'s AndroidJunitRunnerSample, which has been updated to use the new
You also get the error message if you use a test rule in Kotlin and write it Java style
@Rule var mainActivityActivityTestRule = ActivityTestRule(MainActivity::class.java)
You have to change @Rule to @get:Rule
@Rule
@get:Rule
@get:Rule var mainActivityActivityTestRule = ActivityTestRule(MainActivity::class.java)