question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

org.junit.runners.model.InvalidTestClassError starting with Android Studio Dolphin | 2021.3.1

See original GitHub issue

With previous version Android Studio 2021.2.1.14 it works fine, with the latest stable one every single time I try to run a local instrumented test class it throws the following exception:

org.junit.runners.model.InvalidTestClassError: Invalid test class 'x.y.z':
  1. No runnable methods
	at org.junit.runners.ParentRunner.validate(ParentRunner.java:525)
	at org.junit.runners.ParentRunner.<init>(ParentRunner.java:92)
	at org.junit.runners.BlockJUnit4ClassRunner.<init>(BlockJUnit4ClassRunner.java:74)
	at androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner.<init>(AndroidJUnit4ClassRunner.java:43)
	at androidx.test.internal.runner.junit4.AndroidJUnit4Builder.runnerForClass(AndroidJUnit4Builder.java:65)
	at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:70)
	at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:37)
	at androidx.test.internal.runner.AndroidRunnerBuilder.runnerForClass(AndroidRunnerBuilder.java:153)
	at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:70)
	at androidx.test.internal.runner.TestLoader.doCreateRunner(TestLoader.java:73)
	at androidx.test.internal.runner.TestLoader.getRunnersFor(TestLoader.java:105)
	at androidx.test.internal.runner.TestRequestBuilder.build(TestRequestBuilder.java:804)
	at androidx.test.runner.AndroidJUnitRunner.buildRequest(AndroidJUnitRunner.java:613)
	at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:411)
	at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2248)

Tested also with beta & canary and got the same result. Android Studio -> Preferences -> Build, Execution, Deployment -> Testing -> Run Android Instrumented Tests using Gradle is UNCHECKED

Jupiter 5.9.0 de.mannodermaus.junit5:android-test-core:1.3.0 de.mannodermaus.junit5:android-test-runner:1.3.0 classpath(“de.mannodermaus.gradle.plugins:android-junit5:1.8.2.1”)

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:4
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mihaicristianpetrescucommented, Oct 24, 2022

@mannodermaus Any thoughts on this one? It will start to fallback even further as more Android Studio releases go out + now we are restricted to using “com.android.tools.build:gradle:7.2.0” due to the older Android Studio version (2021.2.1.14).

0reactions
mihaicristianpetrescucommented, Oct 29, 2022

I have tried to get more details from the runs but I haven’t been able to pull more data out of the instrumentation runs. If I remove the JUnit 5 from the project both Unit Tests & Instrumentations should fails since they are build atop the JUnit 5 and use a lot of features available only in JUnit 5, so it’s not an actual options.

Yeah I was curious to find out if there’s something that your plugin might be leaning on something specific from Android Studio and that’s why it needs to have that checkbox turned on now or in general and it was a “fluke” until the latest version that it worked without it checked.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android Studio Dolphin | 2021.3.1
Android Studio is the official IDE for Android development, and includes everything you need to build Android apps. This page lists new features...
Read more >
android studio - Dolphin 2021.3.1 not launching - Stack Overflow
When I am clicking on Android Studio icon, it's not starting. I tried to open it from the Terminal, but I had this...
Read more >
Issues · mannodermaus/android-junit5 - GitHub
org.junit.runners.model.InvalidTestClassError starting with Android Studio Dolphin | 2021.3.1. #284 opened on Sep 22 by mihaicristianpetrescu.
Read more >
Cannot sync project on Android Studio Dolphin 2021.3.1 ...
I am having this error in syncing Gradle. 'java.util.List org.jetbrains.kotlin.idea.roots.ProjectRootUtilsKt.findAll(com.intellij.openapi.
Read more >
Developing Android unit and instrumentation tests - Tutorial
It describes how to execute these tests via Android studio and Gradle. ... The library provides a JUnit 4-compatible test runner ( AndroidJUnitRunner...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found