https://kotlinlang.org logo
Title
s

snowe

01/12/2022, 5:11 AM
why am I unable to resolve
JsonFeature
even if I have
ktor-client-json
as a dependency? It was working at some point and now I cannot get it to work, even if I create a new project using the ktor intellij creator. Maven is just completely unable to resolve the
.json.
package.
i’m also unable to resolve CIO even if I have
<dependency>
      <groupId>io.ktor</groupId>
      <artifactId>ktor-client-cio</artifactId>
      <version>${ktor_version}</version>
    </dependency>
as a dependency. This makes no sense.
also have
<dependency>
      <groupId>io.ktor</groupId>
      <artifactId>ktor-client-serialization</artifactId>
      <version>${ktor_version}</version>
    </dependency>
as a dependency, which should pull in
ktor-client-json
, and it is showing up fine as a dependency, but for some reason my code is completely unable to resolve the types. This is with a project generated straight from the generator.
I had to explicity add the
-jvm
to the end for some reason. In the past I’ve not had to do this. I’m not sure why now I need to.
a

Aleksei Tirman [JB]

01/13/2022, 2:40 PM
There are some problems with Gradle cache that anyone experiences from time to time.
s

snowe

01/13/2022, 11:32 PM
@Aleksei Tirman [JB] so should I be able to resolve these dependencies without using
-jvm
? Because I had wiped my gradle cache (that’s initially what I thought the problem was), and it didn’t resolve the issue.
a

Aleksei Tirman [JB]

01/14/2022, 5:58 AM
Did you remove ~/.m2 and ~/.gradle directories?
s

snowe

01/21/2022, 7:14 AM
no, I had deleted the cache directory in the
~/.gradle
directory