Instrumented test not compiling

Trying to execute an instrumented test class I have an error with the task compileDebugAndroidTestKotlin in this line
private lateinit var scenarioEmail: FragmentScenario

For that code:

@RunWith(AndroidJUnit4::class)
class LoginUiTest {

private lateinit var scenarioEmail: FragmentScenario<CheckEmailFragment>
private lateinit var scenarioSignup: FragmentScenario<SignupFragment>

@Before
fun setup() {
    scenarioEmail = launchFragmentInContainer<CheckEmailFragment>()
    scenarioSignup = launchFragmentInContainer<SignupFragment>()
}

@Test
fun whenEmailOkNavigationToPasswordDone() {
    val email = "albert@b4workapp.com"
    onView(withId(R.id.edt_email)).perform(typeText(email), closeSoftKeyboard())
    onView(withId(R.id.btnNext)).perform(click())
    IdlingPolicies.setMasterPolicyTimeout(1, TimeUnit.SECONDS)
    IdlingPolicies.setIdlingResourceTimeout(1, TimeUnit.SECONDS)
    onView(withId(R.id.btnAction)).check(matches(isDisplayed()))
}

}

The error says:

  • Type argument is not within its bounds: should be subtype of ‘Fragment’
    and * Cannot access class ‘androidx.fragment.app.FragmentFactory’. Check your module classpath for missing or conflicting dependencies

But my class inherits at some point of Fragment class. The inheritance is:
MyFragment > RBasePFragment > BaseFragment > androidx.app.Fragment()

about the dependencies i have two dependencies of the fragment library:
1.5.4 and 1.8.3 all of them have the FragmentFactory class

I don’t know Android, so this is probably a dumb question — but is the Fragment you need to be a subtype of the same androidx.app.Fragment that you inherit from?

Whenever classes get confused or don’t seem to match up, and there’s no obvious cause, it’s always worth checking their fully-qualified classnames. Simple classnames are usually unique within a project, and Kotlin and Java do a good job of hiding them from you, but just occasionally they can trip you up. (For example, I recently got into trouble mixing up kotlin.random.Random with java.util.Random; there’s also kotlin.collections.List and java.util.List, and many different Date classes…)

Yes, my base Fragment class inherits from androidx.app.Fragment