https://kotlinlang.org logo
Docs
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
library-development
  • s

    Slackbot

    05/27/2021, 4:47 AM
    This message was deleted.
    :not-kotlin: 1
    l
    1 reply · 2 participants
  • b

    Big Chungus

    06/16/2021, 11:40 PM
    Before I go implementing it, are there any kotlin.js wrappers for github actions sdk out there?
    i
    1 reply · 2 participants
  • m

    mbonnin

    06/21/2021, 7:02 PM
    I just got hit by
    Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.16
    and I'm wondering how safe it is to compile libs with Kotlin 1.5 if you expect consumers to use 1.3 or 1.4 for some reason. I was under the impression that it would work but this message seems to indicate otherwise. There are a few stack overflow github issue and everytime the solution seems to bump the Kotlin version in the consumer project, which might not always be possible easily. Has anyone more details about how safe it is?
    e
    t
    17 replies · 3 participants
  • a

    Andrei Oshanin

    07/02/2021, 9:57 AM
    👋 Hello everyone, JetBrains would like to better understand the experiences of those who author Kotlin libraries. If you’ve ever developed one and you’d like to tell us about it, please fill out this form and we’ll get back to you to learn more. Thank you and have a nice day!
    👍 1
    👍🏼 1
    ✅ 2
    l
    5 replies · 2 participants
  • m

    mbonnin

    07/12/2021, 9:39 AM
    I see libs prefixing their
    alpha
    versions with
    "0"
    but not doing it for their releases: •
    3.2.1
    •
    3.3.0-alpha01
    Is there a reason for this? If I read https://docs.gradle.org/current/userguide/single_versions.html#version_ordering correctly, it will also work without the leading
    "0"
    , Gradle should consider
    alpha10 > alpha2
    in all cases ?
    j
    l
    +2
    116 replies · 5 participants
  • j

    joseph_ivie

    08/24/2021, 6:58 PM
    I would like some advice. We developed some large libraries that we use for internal development - essentially a framework - at my current workplace. They're all open source, but we haven't really put a ton of effort into advertising them, and they need some more polish for public use. I'm one of the few who maintains the package, and I'm concerned that their lack of common use is going to cause great problems in the future. In this case, the library is a set of Kotlin compiler plugins that transpile Android Kotlin apps to human-readable Swift and Typescript apps due to our need to use each platform's native language as per client request. We have this working, and it is currently running several projects in production. This goes in combination with a set of libraries (including UI, network requests, etc) for app development that work across all of the languages, using Rx as a backbone because it exists across all the languages in question. Is anyone interested in this? Should I find a way to get our company to maintain it more, or should I get our company to abandon it? (At the moment, my boss has the libraries GPL'd with a separate license for commercial usage. I want to get it changed to something totally open like Apache, and I think I can convince him if we want to continue maintaining.) In addition, what have you guys found works for advertising a library? What helps keep a library nice?
    a
    r
    +1
    7 replies · 4 participants
  • a

    Alina Dolgikh [JB]

    09/10/2021, 2:22 PM
    Hi everyone! We would like to improve the experience of Kotlin library authors, and now are conducting research to decide which areas to prioritize. If you’ve worked on your own library or plan to create one, please share your feedback with us by taking this survey: https://surveys.jetbrains.com/s3/sl-kotlin-libraries-authors-survey
    :kotlin-intensifies: 3
    ✔️ 7
    r
    1 reply · 2 participants
  • a

    altavir

    09/10/2021, 3:34 PM
    By the way, one of the questions, covered in the survey is the discoverability. Let me remind you about very nice tool https://kotlin.link/ by @irus
    ☝️ 1
    ☝️🏼 1
    b
    2 replies · 2 participants
  • l

    louiscad

    09/14/2021, 9:12 AM
    Jitpack allows to republish for 7 days, ideal to publish malware… Please, folks, use MavenCentral until we get something simpler to setup that still is serious about security.
    ➕ 7
    a
    s
    +2
    4 replies · 5 participants
  • r

    Rafael Costa

    10/31/2021, 5:42 AM
    Hi guys 👋 what is the expected difference between alpha / beta? Are APIs expected to not change after beta or can they still change? Where can I find good resources about versioning of Android/Kotlin libraries? Thanks in advance!
    a
    4 replies · 2 participants
  • m

    Matthew Pope

    11/17/2021, 1:00 AM
    I want to build a library using Kotlin 1.6 but make sure that it’s still usable by consumers who are using Kotlin 1.3. (I know it’s deprecated, but I have some of those consumers still.) I’ve found some info in the Kotlin documentation, Stack Overflow, etc., but I’m still not certain, so I hope some of the great minds here can confirm or deny my suspicions. If I set
    apiVersion = "1.3"
    and force my tests to use a
    1.3.n
    version of
    kotlin-stdlib-jdk
    , that should both set and validate that my library will work for consumers using Kotlin 1.3, right? (The relevant excerpts from my
    build.gradle
    file are in the thread so I don’t spam the channel with a wall of build script.)
    b
    m
    +1
    17 replies · 4 participants
  • m

    mbonnin

    11/22/2021, 4:01 PM
    How bad is it to use
    @OptIn(ExperimentalContracts::class)
    in a library? Looks like
    contracts {}
    blocks do not generate any bytecode (besides metadata?) so as long as it's only used internally it should be fine?
    j
    b
    3 replies · 3 participants
  • r

    Rafael Costa

    11/25/2021, 11:44 AM
    Imagine you have a Compose library that is in beta and you want to start releasing two artifacts per version: one that also uses beta Compose dependencies and another that uses stable Compose dependencies internally. How would you name the two artifacts versions? I was using something like
    0.9.0-beta
    but now the idea would be something like (just to convey the point, not that I’d call them that, I guess?)
    0.9.1-beta-stable
    and
    0.9.1-beta-beta
    .
    j
    b
    8 replies · 3 participants
  • k

    Kyle Roe

    12/03/2021, 4:25 PM
    Hey everyone 👋 While working at different places on different projects its always been interesting how developers choose to go about creating models for unit tests. I've seen some projects redundantly create new models for each and every test, and some projects create factories, with static models that they then use everywhere. Long story short, at work we wanted to clean up some of these tests so two of us started working on a library that would automat this for us and generate random models with actual data. The fruits of our labor can be found below 🤓 We have been using it in production for about 6 months now 🚀 We would be eternally grateful for any feedback you might have 🙏 and to see wether it potentially fits your use cases as well. Please take a look, try it out and let us know what you think 🙌 Collaboration welcome 👩‍💻 👨‍💻 https://github.com/HelloCuriosity/model-forge
    👀 1
    c
    1 reply · 2 participants
  • m

    mbonnin

    12/07/2021, 2:31 PM
    When a function takes a
    Closeable
    as a parameter, is there a nice way to indicate whether the function actually closes the
    Closeable
    or if it's the caller responsibility? Ideally looking at the signature only?
    l
    62 replies · 2 participants
  • m

    mbonnin

    12/17/2021, 3:58 PM
    Are there any plans to add source compatibility checks to https://github.com/Kotlin/binary-compatibility-validator ? As of now it's super easy to change a parameter name and not notice it until calling code breaks
    ➕ 8
    e
    4 replies · 2 participants
  • z

    zsmb

    01/18/2022, 9:06 AM
    I’m trying to figure out whether Kotlin 1.6 brings any new binary incompatibility with older language versions. In other words, if a project moves to Kotlin 1.6 and it has library dependencies that are some older 1.X version, could it break (more than if it used Kotlin 1.5)? I found the following in the 1.6 release notes, but I’m not sure if this means source compat, binary compat, all of the above, or something else entirely.
    Starting with Kotlin 1.6.0, we will support development for three previous API versions instead of two, along with the current stable one. Currently, we support versions 1.3, 1.4, 1.5, and 1.6.
    j
    m
    6 replies · 3 participants
  • l

    Lulu

    02/20/2022, 11:17 PM
    Is creating new objects for received requests a discouraged practice?
    a
    3 replies · 2 participants
  • r

    Rak

    03/23/2022, 10:01 AM
    Hi, I hope this is the right channel to ask this: I am building a sdk for use by our customers. They will embed the sdk in their apps. The sdk takes a picture and then sends to our backend for analysis and returns a result. My questions are: 1. best way to hand control to the sdk. I am currently having the host app start an activity. Other options are StartActivityForResult and the new version of it. Another is a global singleton object initialised by the host and methods called on it. 2. how to distribute the sdk without supplying source code?
    m
    1 reply · 2 participants
  • n

    Nathan Bedell

    04/21/2022, 11:04 PM
    Hey all, I hope this is the right place for this, but I'm curious if anyone has written a library like this for Kotlin. If not, I might try my hand at porting it at some point. I'd love to have something like this at work (where we use several DSLs written in Kotlin). https://github.com/zesterer/ariadne
    a
    2 replies · 2 participants
  • m

    Matthew Pope

    05/13/2022, 6:09 PM
    Does anyone have an example of how they incorporate the binary compatibility validator plugin in a CI workflow? I get how to run it, but I'm not sure when it should be run. Pre-release? Every build? Something else? What has worked for you?
    i
    m
    +1
    16 replies · 4 participants
  • v

    Vivek Modi

    05/18/2022, 10:56 PM
    Hey guys, I am learning library development. So I completed the mavenLocal chapter. Now I want to publish library in github packages with private repository . So now I tried some piece of code but it's not working and I cannot understand, so someone guide me. I am adding my build.gradle.kts in thread.
    j
    m
    20 replies · 3 participants
  • v

    Vivek Modi

    05/19/2022, 9:24 AM
    Hey I tried to use
    ./gradlew publish
    I am getting error. My build.gradle.kts. I am getting error on this
    * What went wrong:
    Execution failed for task ':publishKotlinMultiplatformPublicationToKotlinMultiplatfromProjectRepository'.
    > Failed to publish publication 'kotlinMultiplatform' to repository 'KotlinMultiplatfromProject'
       > Could not PUT '<https://maven.pkg.github.com/vivek-modi/KotlinMultiplatfromProject/me/vmodi/KotlinMultiplatfromProject-kotlinMultiplatform/1.0.0/KotlinMultiplatfromProject-kotlinMultiplatform-1.0.0.jar>'. Received status code 422 from server: Unprocessable Entity
    m
    3 replies · 2 participants
  • m

    mbonnin

    05/21/2022, 11:15 AM
    What's everyone planning to do with 1.7 around the corner? 1️⃣ Upgrade my lib asap, moving the ecosystem faster 🚀 2️⃣ Wait a bit for consumers to update first so that they have less compatibility issues 🧘
    2️⃣ 2
    1️⃣ 9
    j
    g
    +1
    22 replies · 4 participants
  • r

    Rafael Costa

    05/27/2022, 9:00 AM
    Hey guys, I am experiencing a big delay on for the new published artifact to be available in maven central. I usually see it there after like 30min - 1hour. This time I left it over night and it is still not there. Have you guys ever experienced this? Is there something I can do? Btw this is where I usually check if it is available: (I was hoping to see 1.5.8-beta) https://repo1.maven.org/maven2/io/github/raamcosta/compose-destinations/core/
    j
    j
    27 replies · 3 participants
  • t

    TheOnlyTails

    05/29/2022, 9:33 AM
    Is the kotlin libs publisher plugin still maintained? I want to use it in my project but it doesn't support sonatype s01. https://github.com/Kotlin/kotlin-libs-publisher
    👀 2
    a
    2 replies · 2 participants
  • r

    rkeazor

    07/01/2022, 2:02 AM
    Hey how do you all, protect against Binary Compatibility issues in your libs. Let's say your working with DataClasses in a library module which is a known culprit of this . But you know that data class may grow in properties over time, what would be the best course of action to prevent binary compatibility?
    t
    d
    +2
    11 replies · 5 participants
  • a

    aenri

    07/11/2022, 1:45 AM
    I'm not sure if this goes here, but whenever I try and publish a multiplatform library, gradle fails at the task
    :generateMetadataFileForKotlinMultiplatformPublication
    with the error
    Invalid publication "kotlinMultiplatform"
    while using the
    maven-publish
    plugin. Is this something that there's a fix for or should I be doing something else to publish my library?
    l
    a
    2 replies · 3 participants
  • l

    Lukellmann

    07/19/2022, 1:12 PM
    What warning do you have to suppress to still use a deprecated symbol with level
    HIDDEN
    ? for
    WARNING
    and
    ERROR
    you can do this:
    @Deprecated("w", level = DeprecationLevel.WARNING)
    val w = "w"
    
    @Deprecated("e", level = DeprecationLevel.ERROR)
    val e = "e"
    
    @Deprecated("h", level = DeprecationLevel.HIDDEN)
    val h = "h"
    
    println(@Suppress("DEPRECATION") w)
    println(@Suppress("DEPRECATION_ERROR") e)
    println(@Suppress("?? what goes here ??") h)
    z
    i
    8 replies · 3 participants
  • l

    Lukellmann

    07/23/2022, 4:48 PM
    We have two different kinds of
    @RequiresOptIn
    annotations in our library. 1. Experimental annotations for some new API that might change.
Powered by Linen
Title
l

Lukellmann

07/23/2022, 4:48 PM
We have two different kinds of
@RequiresOptIn
annotations in our library. 1. Experimental annotations for some new API that might change.
View count: 7