Daniel Souza Bertoldi
09/26/2024, 1:03 PMio
dependencies, no ideia why. I'll post my code + the error in the thread.Daniel Souza Bertoldi
09/26/2024, 1:03 PM#!/usr/bin/env kotlin
@file:Repository("<https://repo1.maven.org/maven2/>")
@file:DependsOn("io.ktor:ktor-client-core:2.3.12")
@file:DependsOn("io.ktor:ktor-client-cio:2.3.12")
@file:DependsOn("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1")
import kotlinx.coroutines.*
import io.ktor.client.*
GlobalScope.launch {
val client = HttpClient(CIO)
val response: HttpResponse = client.get("<https://storage.googleapis.com/panels-api/data/20240916/media-1a-i-p~s>")
println("Response status: ${response.status}")
client.close()
}
Error:
test.main.kts:10:8: error: unresolved reference 'io'.
import io.ktor.client.*
Daniel Souza Bertoldi
09/26/2024, 1:05 PMephemient
09/27/2024, 4:12 PMephemient
09/27/2024, 4:13 PM@file:DependsOn("io.ktor:ktor-client-core-jvm:2.3.12")
@file:DependsOn("io.ktor:ktor-client-cio-jvm:2.3.12")
because the maven resolver isn't smart enoughDaniel Souza Bertoldi
09/27/2024, 7:26 PM