android / android/testing-samples
Not compiling test class with a fragment that not inherits directly but indirectly from Fragment class
- Lingua principale
- Java
- Stelle
- 9.3k
- Fork
- 3.6k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
I'm working with this code:
```
@RunWith(AndroidJUnit4ClassRunner::class)
class FiltersFragmentTest {
@Test
fun fragmentIsVisible() {
val scenario = launchFragmentInContainer()
scenario.recreate()
Espresso
.onView(ViewMatchers.withId(R.id.jvQuery))
.check(matches(isDisplayed()))
}
}
```
The FiltersFragment class inherits from a class custom, that inherits from another custom base fragment class that inherits from Fragment (androidx.fragment.app.Fragment). But when trying to execute the test an error is shown in compile time
Cannot access class 'androidx.fragment.app.FragmentFactory'. Check your module classpath for missing or conflicting dependencies
Type argument is not within its bounds: should be subtype of 'Fragment'
I see in my project dependencies two versions of fragment library: 1.3.6 for appCompat library use and direct dependency 1.6.2
Both have FragmentFactory class inside
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia dal punto di ingresso FiltersFragmentTest e dalle dichiarazioni delle dipendenze del modulo; riproduci la compilazione di launchFragmentInContainer e ispeziona le versioni risolte di androidx.fragment. Conferma se il test viene compilato quando Fragment è ereditato indirettamente e registra lo stato delle dipendenze/versioni che determina il risultato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- android, kotlin
- Ambito
- mobile-dev, testing
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 35/100