Search code examples
androidandroid-recyclerviewfirebase-test-lab

java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/widget/RecyclerView when running recorded Robo test on Firebase test lab


I have recorded a Robo test in Android Studio and I run the file in Firebase Test Lab as a Robo test - it fails with the following stack trace when the test tries to click on the RecyclerView elements:

enter image description here

     FATAL EXCEPTION: Thread-12
Process: com.transfollow.tf, PID: 12981
java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/widget/RecyclerView;
    at androidx.test.espresso.contrib.RecyclerViewActions$ActionOnItemAtPositionViewAction.getConstraints(Unknown Source:0)
    at androidx.test.espresso.ViewInteraction$SingleExecutionViewAction.getConstraints(ViewInteraction.java:3)
    at androidx.test.espresso.ViewInteraction.a(ViewInteraction.java:14)
    at androidx.test.espresso.ViewInteraction$1.call(ViewInteraction.java:2)

The app uses androidX and jetifier that's why the app instrumentation tests work fine, even though the RecyclerViewActions has references to support v7 libs. But why does this happen with robo and what can be done to fix this?


Solution

  • This issue was recently fixed and the updated Robo should work correctly with both android and androidx RecyclerViews. We will release the updated Robo shortly, at which point your FTL Robo tests will not produce the error above.