https://kotlinlang.org
Join Slack
(I know it's more a Jackson than a Kotlin question, but I hope someone might have an answer anyway)....
n

nkiesel

over 3 years ago
(I know it's more a Jackson than a Kotlin question, but I hope someone might have an answer anyway). I have a line `val jackson: YAMLMapper = YAMLMapper.builder().addModule(KotlinModule()).build()`in my code to create a Jackson YAML mapper with Kotlin extensions. This tells me "Kotlin: 'constructor KotlinModule(Int = ..., Boolean = ..., Boolean = ..., Boolean = ..., SingletonSupport = ..., Boolean = ...)' is deprecated. Use KotlinModule.Builder instead of named constructor parameters". Does that really mean I should use `val jackson: YAMLMapper = YAMLMapper.builder().addModule(KotlinModule.Builder().build()).build()`instead? That's an awful amount of build...
n
e
m
  • 3
  • 7
  • 1175
How do we flatten a JSON with nested elements into a single class? E.g. I’ve to following OSM data t...
b

BollywoodVillain

about 5 years ago
How do we flatten a JSON with nested elements into a single class? E.g. I’ve to following OSM data that I need to have in just one class, without creating a subclass for `tags`:
{
      "type": "node",
      "id": 66917229,
      "lat": 52.5167295,
      "lon": 13.3797732,
      "tags": {
        "addr:city": "Berlin",
        "addr:housenumber": "4a",
        "addr:postcode": "10117",
        "addr:street": "Pariser Platz",
        "amenity": "cafe",
        "brand": "Starbucks",
        "name": "Starbucks",
        "website": "<https://www.starbucks.de/store-locator/store/2099/pariser-platz-pariser-platz-4-a-berlin-be-10117-de>",
        "wheelchair": "yes",
        "wifi": "free"
      }
    }
I am using custom Serializer but I’m a bit lost on how to unwrap the nested values in the
deserialize
function for the nested tags element. Any help is highly appreciated.
b
r
v
  • 3
  • 8
  • 1174
i can't invoke the composable function inside of button onclick.and, I getting this error '@Composab...
p

Praveen Kumar

over 2 years ago
i can't invoke the composable function inside of button onclick.and, I getting this error '@Composable invocations can only happen from the context of a @Composable function'
p
s
  • 2
  • 20
  • 1172
Whats the preferred way to use native File chooser dialog on Compose desktop applications. `java.awt...
s

suresh

about 5 years ago
Whats the preferred way to use native File chooser dialog on Compose desktop applications.
java.awt.FileDialog
seems to be working fine. Is that the recommended way?
👀 5
s
i
m
  • 3
  • 6
  • 1171
hey guys, is there a way to create a `const` list/array inside a companion object in kotlin?
r

Raed Ghazal

over 4 years ago
hey guys, is there a way to create a
const
list/array inside a companion object in kotlin?
🚫 1
r
i
  • 2
  • 2
  • 1167
How do you use multiple xcframeworks exposing the same types from a dependency and map this type? I ...
h

hfhbd

about 3 years ago
How do you use multiple xcframeworks exposing the same types from a dependency and map this type? I want to create a release xcframework used by the ios app and a test xcframework used by the ios tests. Of course the types in the test xcframework should map to the types used by the release xcframework, but at the moment I get different warnings or different error messages depending on the current workarounds I tried.
h
a
+4
  • 6
  • 17
  • 1165
is there a way to get more verbose errors out of the kotlin compiler? When i use `gradlew classes`,...
v

Victor Ng

about 2 years ago
is there a way to get more verbose errors out of the kotlin compiler? When i use
gradlew classes
, I frequently get nothing useful from the compiler>
❯ ./gradlew classes

> Task :kaptGenerateStubsKotlin FAILED
e: Could not load module <Error module>

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':kaptGenerateStubsKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
   > Compilation error. See log for more details

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at <https://help.gradle.org>.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to <https://docs.gradle.org/8.2.1/userguide/command_line_interface.html#sec:command_line_warnings> in the Gradle documentation.

BUILD FAILED in 874ms
3 actionable tasks: 1 executed, 2 up-to-date
not kotlin but kotlin colored 0
v
h
r
  • 3
  • 3
  • 1165
I'm trying to configure a ktor application using the configuration file, as described here: <https:/...
s

Serafeim Papastefanos

almost 3 years ago
I'm trying to configure a ktor application using the configuration file, as described here: https://ktor.io/docs/configurations.html#configuration-file ... I've put a file on my
src/main/resources/application.conf
and works great. However, to deploy the app I create a fat jar. Is there a way to override some configuration options when I deploy that fat jar ? I know that I can use env vars but there are too many options that would need overriding. is it possible to pass another configuration file to the fatjar that would be used to override configuration options ? i.e run it like
java -jar ktor-fat.jar -c local.conf
; when trying to read a configuration value, it will first check
local.conf
, if not found then go to
resources/application.conf
inside the jar
s
a
l
  • 3
  • 7
  • 1164
Hi folks, How do I run a custom gradle task that only runs after the build tasks completes in a KMM ...
k

Kwabena Berko

over 3 years ago
Hi folks, How do I run a custom gradle task that only runs after the build tasks completes in a KMM project?
tasks.register("copySomething", Copy::class) {
   println("How Do I Run This Task After Build Completes?")
}
k
j
m
  • 3
  • 15
  • 1163
what may the cause of "Unresolved reference: Composable" in iosMain? androidx.compose.runtime.Compos...
r

Romão

over 2 years ago
what may the cause of "Unresolved reference: Composable" in iosMain? androidx.compose.runtime.Compose is imported but the compiler outputs error
r
j
+3
  • 5
  • 76
  • 1162
Previous343536Next

kotlinlang

A modern programming language that makes developers happier.

Powered by