kotest-intellij-plugin icon indicating copy to clipboard operation
kotest-intellij-plugin copied to clipboard

Android Studio run from Kotest pannel can't find classes

Open TraceM171 opened this issue 2 years ago • 5 comments

Kotest version: 5.6.2 Kotest IntelliJ plugin version: 1.3.69-IC-2022.2 Android Studio version: 2022.2.1

I am unable to run a single test in Android Studio using the gutter icons.

For example, in the following screenshot: image Trying to run all tests in the spec with the double green run button works as expected, but trying to run the single test that is inside the spec alone with the single play button seems to not find classes and throws ClassNotFoundException for dependencies like kotlin.reflect.full.KClasses or the test subject defined in the main directory.

This behavior also happens when running the spec or single tests from the Kotest plugin tool window.

A minimal sample project where this error shows up can be found in the following repo: https://github.com/TraceM171/kotest-android-studio-error-sample

TraceM171 avatar Jun 11 '23 10:06 TraceM171

Just wanted to report this very issue: whole spec works, single tests don't and fails with java.lang.ClassNotFoundException: kotlin.reflect.full.KClasses.

Android Studio Giraffe | 2022.3.1 Kotest 5.6.2 Kotest plugin 1.3.69-IC-2022.3

I will try to fight, but this might just be the death of Kotest in our team, IDE integration is very important, this issue basically prevents us from debugging a single test in a comfortable way. Yes, there are workarounds, like disabling all the other tests, but DX suffers greatly.

wujek-srujek avatar Aug 09 '23 22:08 wujek-srujek

I tried adding kotlin-reflect to my testImplementation dependencies, and the error I got was similar, but now it failed to find a class from my src/main/kotlin source set, very strange.

wujek-srujek avatar Aug 09 '23 22:08 wujek-srujek

I have same issue. Running the whole spec works, running the single test doesn't: ClassNotFoundException for a class in the main source set.

  • Android Studio Iguana | 2023.2.1 Canary 9
  • Kotest 5.7.2
  • Plugin 1.3.70-IC-2023.2

Pitel avatar Oct 20 '23 07:10 Pitel

Similar issue for me, Running the whole spec works fine, but running a single tests result in UnsatisfiedLinkError because of missing android.util.Log. Main difference I see is that for the whole spec a gradle task is running and for a single test a kotest-configuration is running. I also played with the config, tried to mock android.util.log staticly with mockk (which worked for other scenarios) but did not had any luck getting it to work.

  • Android Studio Iguana | 2023.2.1 RC 1
  • Kotest 5.8.0
  • Plugin 1.3.74-IC-2023.2

AlbRoehm avatar Feb 07 '24 13:02 AlbRoehm

Same issue here:

  • Android Studio Koala | 2024.1.1 Patch 1
  • Kotest 5.9.1
  • Plugin 1.3.13-IC-2024.1.1

Is the team working on it? Currently we're deciding if we change our whole test suite to Kotest. Definitely, this is a stopper for us. We can provide another sample project if it adds value.

edgarmiro avatar Aug 08 '24 08:08 edgarmiro

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 26 '25 14:04 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Keep calm, this problem still happens.

edgarmiro avatar May 12 '25 06:05 edgarmiro

still happens in Studio 2024.3.2 with Kotest plugin 1.3.96-2024.3.1

moddyfire avatar Jul 22 '25 11:07 moddyfire

On

  • Android Studio Narwhal Feature Drop | 2025.1.2 AI-251.26094.121.2512.13840223 July 26, 2025
  • Kotest v6.0.0
  • Kotest Plugin 6.0.101-2025.1

Still not working

waffiqaziz avatar Aug 21 '25 04:08 waffiqaziz

+1

whck6 avatar Aug 26 '25 03:08 whck6