Robolectric AndroidX fragments NoClassDefFoundError
问题 After migration of code and tests to AndroidX , all seems to work pretty well, however Robolectric junit tests for two fragments are failing due to NoClassDefFoundError: androidx/fragment/testing/R$style exception. The stack trace: java.lang.NoClassDefFoundError: androidx/fragment/testing/R$style at androidx.fragment.app.testing.FragmentScenario$EmptyFragmentActivity.onCreate(FragmentScenario.java:79) at android.app.Activity.performCreate(Activity.java:5933) at android.app.Instrumentation