https://kotlinlang.org
Join Slack
hi guys, i am getting ```finishConnect(..) failed: Connection refused: /[0:0:0:0:0:0:0:1]:80; nested...
g

George

almost 3 years ago
hi guys, i am getting
finishConnect(..) failed: Connection refused: /[0:0:0:0:0:0:0:1]:80; nested exception is io.netty.channel.AbstractChannel$AnnotatedConnectException: finishConnect(..) failed: Connection refused: /[0:0:0:0:0:0:0:1]:80
org.springframework.web.reactive.function.client.WebClientRequestException: finishConnect(..) failed: Connection refused: /[0:0:0:0:0:0:0:1]:80; nested exception is io.netty.channel.AbstractChannel$AnnotatedConnectException: finishConnect(..) failed: Connection refused: /[0:0:0:0:0:0:0:1]:80
from a rather simple springboot-kotlin code. Has anyone encountered this? Thanks in advance 🙂
g
c
  • 2
  • 4
  • 1498
Is there a date picker for compose multiplatform that works for both platforms (android,ios)
e

Emmanuel Mtera

over 1 year ago
Is there a date picker for compose multiplatform that works for both platforms (android,ios)
e
d
+2
  • 4
  • 7
  • 1497
Hi, I'm running into this error when trying to use `async` ```Unresolved reference. None of the foll...
d

Daniel

over 4 years ago
Hi, I'm running into this error when trying to use
async
Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public fun <T> CoroutineScope.async(context: CoroutineContext = ..., start: CoroutineStart = ..., block: suspend CoroutineScope.() → TypeVariable(T)): Deferred<TypeVariable(T)> defined in kotlinx.coroutines
I'm not sure how much I can pare down my example, because it seems pretty specific to what I'm trying to do. Here's essentially the function
suspend fun getTile(params: SomeType): GetTileResponse {
        val cached = tileCache.get(params)
        if (cached != null) {
            return GetTileResponse.Available(cached)
        }

        val request = GetTileRequest(params)

        val deferred = async {
            makeRemoteRequest()
            .map { convertIntoResponse(it) }
        }

        return GetTileResponse.Loading(deferred)
    }
If I ask kotlin to generate an implementation of async, I get something which seems to look very similar to the definition of async (https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/async.html)
private fun async(block: suspend CoroutineScope.() -> Either<GetTileError, Bitmap>): Deferred<Either<GetTileError, Bitmap>> {
        TODO("Not yet implemented")
    }
d
a
  • 2
  • 14
  • 1494
I'm trying to update to kotlin 2.0 but our project has -Werror enabled and so we get: ```w: Kapt cu...
z

zsperske

about 1 year ago
I'm trying to update to kotlin 2.0 but our project has -Werror enabled and so we get:
w: Kapt currently doesn't support language version 2.0+. Falling back to 1.9.
e: warnings found and -Werror specified
Is there any way around this?
z
d
  • 2
  • 2
  • 1491
Hello everyone, I want to achieve sticky footer using jetpack compose like in screenshot. A is scrol...
p

Pardip

over 3 years ago
Hello everyone, I want to achieve sticky footer using jetpack compose like in screenshot. A is scrollable list of row items. When A is smaller than screen(or parent) size, B (footer) should be placed bellow the last row. When A+B are bigger than screen size, then B becomes fixed at the bottom and A content is scrollable. I’m wondering if there is easy way to achieve this, using compose ConstraintLayout.
p
t
  • 2
  • 1
  • 1489
What is the current take on Kotlin's native Result vs eg Arrow Either/Try? I've used Either/Try in ...
f

Fred Friis

over 2 years ago
What is the current take on Kotlin's native Result vs eg Arrow Either/Try? I've used Either/Try in my previous team, about to join a team that prefer using Result instead. They seem kinda similar to me (Result needs throwables as errors which is a bit different but whatever) but then there are people that claim that Kotlin devs themselves advocate against using Result in your business code as it will catch all exceptions, which isn't really desirable (see https://stackoverflow.com/questions/70847513/when-and-how-to-use-result-in-kotlin)
f
s
+3
  • 5
  • 56
  • 1487
I convinced ChatGPT from OpenAI to write me Kotlin code that uses a Ktor client to pull down the "<h...
y

Youssef Shoaib [MOD]

over 2 years ago
I convinced ChatGPT from OpenAI to write me Kotlin code that uses a Ktor client to pull down the "https://kotlinlang.org/docs/whatsnew14.html" and asked it for an example of what the code would output (I have to be very wordy with it or else it gets angry and reminds me that it can't run code lol). Eventually, I made it "send a request" to "https://kotlinlang.org/docs/whatsnew19.html", but that produced the same output, just with Kotlin 1.9 as the version number. Finally, I convinced it that Kotlin 1.9 actually includes Union Types (🙏 ) and made it go to the
<h2>
tag that talks about Union types, and print out it and its siblings, and this is what it produced: See 🧵 for some other interesting observations about it, including Kotlin-specific ones, if anyone is curious
y
v
  • 2
  • 10
  • 1473
Hi guys i upgraded to Xcode 15, and i am having issue building the shared module, here is the error ...
b

brabo-hi

almost 2 years ago
Hi guys i upgraded to Xcode 15, and i am having issue building the shared module, here is the error
Please try to disable compiler caches and rerun the build. To disable compiler caches, add the following line to the gradle.properties file in the project's root directory:
    
    kotlin.native.cacheKind.iosArm64=none
    
Also, consider filing an issue with full Gradle log here: <https://kotl.in/issue>
The /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld command returned non-zero exit code: 1.
output:
-iphoneos_version_min has been renamed to -ios_version_min
ld: warning: ignoring duplicate library '-ldl'
ld: unknown options: -sdk_version
b
a
  • 2
  • 1
  • 1469
using `Map` like: `mutableStateOf(map)` and reassigning that `Map` doesn’t trigger recomposition? h...
m

Marko Novakovic

over 3 years ago
using
Map
like:
mutableStateOf(map)
and reassigning that
Map
doesn’t trigger recomposition? how can I approach this?
m
t
+3
  • 5
  • 14
  • 1465
What's the proper way to pass the `-Xexpect-actual-classes` flag to the compiler in 1.9.20-RC? Previ...
j

Jeff Lockhart

over 1 year ago
What's the proper way to pass the
-Xexpect-actual-classes
flag to the compiler in 1.9.20-RC? Previously in 1.9.20-Beta2 I had:
kotlin {
    compilerOptions {
        freeCompilerArgs.add("-Xexpect-actual-classes")
    }
}
But this top-level
compilerOptions
has been removed now. I've tried
tasks.withType<KotlinCompile>().configureEach {
    compilerOptions {
        freeCompilerArgs.add("-Xexpect-actual-classes")
    }
}
and
tasks.withType<KotlinCompile>().configureEach {
    kotlinOptions {
        freeCompilerArgs += "-Xexpect-actual-classes"
    }
}
but still get the warning
'expect'/'actual' classes (including interfaces, objects, annotations, enums, and 'actual' typealiases) are in Beta. You can use -Xexpect-actual-classes flag to suppress this warning. Also see: https://youtrack.jetbrains.com/issue/KT-61573
during compilation.
youtrack 1
j
a
+3
  • 5
  • 13
  • 1453
Previous161718Next

kotlinlang

A modern programming language that makes developers happier.

Powered by