willowtreeapps / assertk

assertions for kotlin inspired by assertj
MIT License
760 stars 85 forks source link

"Unresolved reference: assertThat" on 0.26.1 #477

Open dirkluijk opened 1 year ago

dirkluijk commented 1 year ago

When upgrading from version 0.25.0 to 0.26.1, I suddenly get this weird compiler error:

/path/to/Test.kt:73:9
Kotlin: Unresolved reference: assertThat

my code just imports

import assertk.assertThat
import assertk.assertions.*

Is the artifact broken?

esiha commented 1 year ago

I had the same issue, found the solution on another project with which I also had the issue. If you use Maven, use assertk-jvm instead of assertk as artifactId.

Gradle is able to select the correct multi-platform dependency, Maven isn't.

esiha commented 1 year ago

Credit where it's due: https://github.com/InsertKoinIO/koin/issues/1450

dirkluijk commented 1 year ago

I am using

<dependency>
    <groupId>com.willowtreeapps.assertk</groupId>
    <artifactId>assertk-jvm</artifactId>
    <version>0.26.1</version>
    <scope>test</scope>
</dependency>

and the problem still persists.