title: Robolectric AndroidX fragments NoClassDefFoundError
body: <p>After migration of code and tests to <strong>AndroidX</strong>, all seems to work pretty well, however Robolectric junit tests for two fragments are failing due to <strong>NoClassDefFoundError: androidx/fragment/testing/R$style</strong> exception.
  The stack trace:</p>
  
  <blockquote>
    <p>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.callActivityOnCreate(Instrumentation.java:1105)
      at
    androidx.test.runner.MonitoringInstrumentation.callActivityOnCreate(MonitoringInstrumentation.java:674)
      at
    org.robolectric.android.controller.ActivityController.lambda$create$0(ActivityController.java:69)
      at
    org.robolectric.shadows.ShadowLooper.runPaused(ShadowLooper.java:365)
      at
    org.robolectric.android.controller.ActivityController.create(ActivityController.java:69)
      at
    org.robolectric.android.controller.ActivityController.create(ActivityController.java:74)
      at
    org.robolectric.android.internal.LocalActivityInvoker.startActivity(LocalActivityInvoker.java:39)
      at
    androidx.test.core.app.ActivityScenario.launch(ActivityScenario.java:207)
      at
    androidx.fragment.app.testing.FragmentScenario.internalLaunch(FragmentScenario.java:283)
      at
    androidx.fragment.app.testing.FragmentScenario.launchInContainer(FragmentScenario.java:265)</p>
  </blockquote>
  
  <p>For testing fragments I'm using FragmentScenario, and it seems the FragmentScenario.EmptyFragmentActivity refers to a missing R class from a package androidx.fragment.testing.R:</p>
  
  <blockquote>
    <p>setTheme(getIntent().getIntExtra(THEME_EXTRAS_BUNDLE_KEY,
                       R.style.FragmentScenarioEmptyFragmentActivityTheme));</p>
  </blockquote>
  
  <p>Any idea what might be wrong? Maybe I'm missing a dependency that's not that obvious to me.</p>
  
  <p>Reproducible in following project:
  <a href="https://github.com/marcinbak/androidx-test-error" rel="noreferrer">https://github.com/marcinbak/androidx-test-error</a></p>
  
  <p>Also reported in Google's issue tracker: <a href="https://issuetracker.google.com/issues/122321150" rel="noreferrer">https://issuetracker.google.com/issues/122321150</a></p>