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 can use @JvmField. From documentation
@JvmField
Instructs the Kotlin compiler not to generate getters/setters for this property and expose it as a field
@Rule @JvmField val activityActivityTestRule = ActivityScenarioRule(MainActivity::class.java)