https://kotlinlang.org
Join Slack
Hi ,can somebody share an example okio used in kmm project or a sample project ,the GitHub sample an...
r

Rizwan

over 2 years ago
Hi ,can somebody share an example okio used in kmm project or a sample project ,the GitHub sample and docs not that comprehensive
r
j
  • 2
  • 9
  • 409
Hi there, is it possible to get the name of the constants an enum declares? This isn't possible with...
s

Shreyash Saitwal

about 3 years ago
Hi there, is it possible to get the name of the constants an enum declares? This isn't possible with the traditional Java annotation processing but I was curious if it's something KSP might support.
s
j
b
  • 3
  • 28
  • 409
Suspending functions + unit tests An important piece of my code was buggy but covered by a correct t...
j

jmfayard

over 3 years ago
Suspending functions + unit tests An important piece of my code was buggy but covered by a correct test ... that was ignored because I mistakenly use a suspending function in a JUnit class Gosh it would be so much better if suspending functions were supported directly in Junit instead of the
runTest { ... }
hack The issue is there https://github.com/junit-team/junit5/issues/1914 but very little happened since 3 years I created an issue, please star ⭐️ https://youtrack.jetbrains.com/issue/KT-52818/Provide-a-quick-fix-against-using-suspending-functions-in-Unit-Test
j
s
e
  • 3
  • 9
  • 409
What's the proper way to handle exceptions thrown from composable functions? An unchecked java excep...
s

suresh

almost 5 years ago
What's the proper way to handle exceptions thrown from composable functions? An unchecked java exception thrown from a composable function has frozen the UI and there is no way to recover from it gracefully. So in this case I want to catch (Something like
Thread.UncaughtExceptionHandler
) and continue the recomposition or is this some kind of anti-pattern in compose? 
Exception in thread "AWT-EventQueue-0 @coroutine#2" java.lang.IndexOutOfBoundsException: Index 5 out of bounds for length 5
	at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
	at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
	at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
	at java.base/java.util.Objects.checkIndex(Objects.java:359)
	at java.base/java.util.ArrayList.get(ArrayList.java:427)
	at androidx.compose.material.TabRowKt$TabRow$1.invoke(TabRow.kt:117)
	at androidx.compose.material.TabRowKt$TabRow$1.invoke(TabRow.kt)
s
t
j
  • 3
  • 4
  • 409
Hi, I have a bit of an issue with my rotary input. My app crashes, with this friendly error message:...
n

Nat Strangerweather

over 2 years ago
Hi, I have a bit of an issue with my rotary input. My app crashes, with this friendly error message: FocusRequester is not initialized. Here are some possible fixes: 1. Remember the FocusRequester: val focusRequester = remember { FocusRequester() } 2. Did you forget to add a Modifier.focusRequester() ? 3. Are you attempting to request focus during composition? Focus requests should be made in response to some event. Eg Modifier.clickable { focusRequester.requestFocus() } 1 and 2 are done. As for 3, that may be the problem, but I am not sure what I am doing wrong. Please could someone have a look at my code in thread?
n
y
  • 2
  • 21
  • 408
I can call `internal` symbols from other modules using `@Suppress("INVISIBLE_MEMBER")`or `"INVISIBLE...
m

mcpiroman

over 3 years ago
I can call
internal
symbols from other modules using `@Suppress("INVISIBLE_MEMBER")`or
"INVISIBLE_REFERENCE"
. However that does not work for internal setter on a property. How can I suppress
Cannot assign to ...: the setter is internal in ...
?
m
e
+2
  • 4
  • 11
  • 408
Hi, I’m having trouble making detect autoformat too long lines. Here’s my config: ```build: maxIs...
e

Endre Deak

about 4 years ago
Hi, I’m having trouble making detect autoformat too long lines. Here’s my config:
build:
  maxIssues: 0
  excludeCorrectable: false

config:
  validation: true
  warningsAsErrors: false

processors:
  active: true

comments:
  active: true
  UndocumentedPublicClass:
    active: true
    excludes: [ '**/test/**', '**/integrationTest/**', '**/systemTest/**', '*Test' ]
    searchInNestedClass: true
    searchInInnerClass: true
    searchInInnerObject: true
    searchInInnerInterface: true
  UndocumentedPublicFunction:
    active: true
    excludes: [ '**/test/**', '**/integrationTest/**', '**/systemTest/**', '*Test' ]
  UndocumentedPublicProperty:
    active: true
    excludes: [ '**/test/**', '**/integrationTest/**', '**/systemTest/**', '*Test' ]

formatting:
  active: true
  autoCorrect: true
  MaximumLineLength:
    active: true
    autoCorrect: true
    maxLineLength: 120
    ignoreBackTickedIdentifier: true
configuration:
detekt {
    toolVersion = "1.18.1"
    config = files("config/detekt/detekt.yml")
    buildUponDefaultConfig = true
    autoCorrect = true
    debug = true
}
I have a line longer than 120 chars and doesn’t get formatted correctly when I run
gradle detekt
. What do I miss here?
e
c
  • 2
  • 8
  • 408
`More than one file was found with OS independent path 'META-INF/AL2.0'.` Added exclude to the packa...
j

Jeremy

over 4 years ago
More than one file was found with OS independent path 'META-INF/AL2.0'.
Added exclude to the packagingOptions in android{} but still getting err. This is occurring only for instrumented tests. Any ideas?
j
g
  • 2
  • 3
  • 408
Can ksp be used as a drop-in replacement for kapt with hibernate-jpamodelgen? When I tried it, no so...
s

Stewart Stewart

almost 4 years ago
Can ksp be used as a drop-in replacement for kapt with hibernate-jpamodelgen? When I tried it, no sources were generated.
s
j
+3
  • 5
  • 7
  • 407
Ive finally managed to get kotlin/wasm app on docker compose and nginx. So in case anyone else strug...
h

hello

over 1 year ago
Ive finally managed to get kotlin/wasm app on docker compose and nginx. So in case anyone else struggles or searches for info I will leave it here
# syntax=docker/dockerfile:1
FROM gradle:8.4.0-jdk17 AS builder
COPY --chown=gradle:gradle . /home/gradle/src
WORKDIR /home/gradle/src

RUN gradle wasmJsBrowserDistribution --no-daemon

FROM nginx:alpine
COPY --from=builder /home/gradle/src/composeApp/build/dist/wasmJs/productionExecutable/ /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
compose
version: '3.9'
services:
  kotlin-wasm-app:
    networks:
      - frontend
    container_name: test-app
    hostname: test-app
    restart: always
    build: .
    ports:
      - "8000:80"
    volumes:
      - ./:/codex

networks:
  frontend:
    name: custom_network
    driver: bridge
K 6
🚀 2
h
y
  • 2
  • 2
  • 407
Previous165166167Next

kotlinlang

A modern programming language that makes developers happier.

Powered by