Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Studio run from Kotest pannel can't find classes #260

Open
TraceM171 opened this issue Jun 11, 2023 · 4 comments
Open

Android Studio run from Kotest pannel can't find classes #260

TraceM171 opened this issue Jun 11, 2023 · 4 comments

Comments

@TraceM171
Copy link

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

@wujek-srujek
Copy link

wujek-srujek commented Aug 9, 2023

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
Copy link

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.

@Pitel
Copy link

Pitel commented Oct 20, 2023

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

@AlbRoehm
Copy link

AlbRoehm commented Feb 7, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants