https://kotlinlang.org logo
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
  • 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
    • 3
    • 2
  • 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
    • 3
    • 8
  • 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.
  • l

    Lukellmann

    07/23/2022, 4:54 PM
    We have two different kinds of
    @RequiresOptIn
    annotations in our library. 1. Annotations for new experimental API that might change. 2. Annotations for API that is easy to use incorrectly. Which
    AnnotationRetention
    should be used in each case? (
    BINARY
    or
    RUNTIME
    ,
    SOURCE
    isn't allowed)
    i
    • 2
    • 1
  • g

    George

    08/17/2022, 4:24 PM
    Hello folks, Im trying to publish a kotlin-jvm-only library which is dependent to an internally library of mine. When i publish it, i try to consume it in my demo-project but it asks for the jar of the internal module of mine. What are my options if lets say i cant publish directly at least the internal lib? Thanks in advance for any answers or help.
    b
    r
    • 3
    • 7
  • y

    Yashwant Gowla

    08/23/2022, 2:06 PM
    https://www.linkedin.com/posts/yashwant-gowla-3167a8110_simform-opensourcedevelopment[…]813765550080-MobN?utm_source=share&utm_medium=member_desktop
  • y

    Yashwant Gowla

    08/25/2022, 7:23 AM
    Check it out and hit star this repo. https://github.com/SimformSolutionsPvtLtd/SSComposeCookBook Awesome Mobile Libraries. Check it out and hit star this repo. https://github.com/SimformSolutionsPvtLtd/Awesome-Mobile-Libraries
  • x

    xxfast

    09/12/2022, 12:23 AM
    Open for feedback 🙂 https://kotlinlang.slack.com/archives/C0BJ0GTE2/p1662937749366859
  • g

    George

    09/20/2022, 12:22 PM
    Hi folks, i am developing an SDK for my application's APIs and i have come across a dilemma, in requests like
    getAccount(): Accounts
    do you prefix your entities or not? Thanks in advance for any answer !
    m
    j
    +2
    • 5
    • 25
  • t

    Trey

    10/22/2022, 3:19 PM
    Can somebody tell me how to update the artifact IDs of the different components? My shared module is named "mobileSdk", but I prefer it to be deployed as "mobile-sdk". I'm calling setArtifactId() in " publications.withType<MavenPublication> {", but it only applies to the root artifact.
    • 1
    • 1
  • r

    Rafael Costa

    10/26/2022, 4:41 PM
    Can someone confirm to me that we cannot publish to maven central from a private GitHub repository? I have a use case at work where I'd like to do that, but all I read talks about public GitHub repositories 🤔
    a
    m
    b
    • 4
    • 36
  • o

    Oussama Bentalha

    10/28/2022, 8:53 AM
    Hi all, I would like to create a library for my mobile app, having a common logic + specific custom components per platform (android and iOS). I've created a common base code in the commonMain, I've also created a CustomButton in the AndroidMain that can be use by my android app. Now the question is, is it possible to create custom components on the iOSMain and use it specifically in my iOS app, I checked and couldn't find any example (except for KMM App but I'm doing a KMM lib). Thanks in advance
    t
    • 2
    • 2
  • r

    Rafael Costa

    11/11/2022, 7:01 PM
    Hey guys! Maybe someone has gone through a similar thing.. How bad is this? I mean.. it feels pretty hacky, but it's just sooo much more convenient to make users of my library able to write unit tests with no additional setup 😛
    @SuppressLint("NewApi", "ObsoleteSdkInt")
    internal fun ByteArray.toBase64Str(): String {
        // Both these methods (from java util and android util) seem to
        // do exactly the same.
        // The second doesn't work on Unit tests and the first doesn't work
        // on older devices.
        // Also, on unit tests SDK_INT is 0, but we're running on the developer's machine
        // So we can still use java.util in that case
    
        return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O || Build.VERSION.SDK_INT == 0) {
            java.util.Base64.getUrlEncoder().encodeToString(this)
        } else {
            android.util.Base64.encodeToString(this, Base64.URL_SAFE or Base64.NO_WRAP)
        }
    }
    e
    • 2
    • 17
  • a

    Alina Grebenkina

    11/17/2022, 5:30 PM
    :kotlin-intensifies-purple: Kotlin 1.8.0-Beta brings the following updates: • Gradle 7.3 compatibility • Recursive
    Path
    utility functions in the stdlib • Support for Xcode 14 in Kotlin/Native • Discontinuation of support for the old JVM backend Try it out and share your feedback! 👉 https://kotlinlang.org/docs/whatsnew-eap.html Why install Beta? If you’re a library author, working with EAP versions allows you to support the latest Kotlin versions in your library almost immediately with the Stable release, which makes your users happier and your library more popular.
  • a

    andylamax

    11/18/2022, 8:44 AM
    In java, one can build a library with the Latest possibpe version, but targets lower versions (mostly 1.8) during compilations. So yoy tend to use late technology, but keep users of the old ones happy. Do we have something similar for kotlin??
    m
    • 2
    • 4
  • p

    Piotr Krzemiński

    11/24/2022, 10:53 AM
    cross-post: https://kotlinlang.slack.com/archives/C0BJ0GTE2/p1669283560214619
    j
    • 2
    • 5
  • p

    Piotr Krzemiński

    11/24/2022, 1:19 PM
    continuation of this discussion
    b
    m
    • 3
    • 25
  • h

    holgerbrandl

    01/21/2023, 9:20 AM
    Hi there, when building a library, how could I flag certain functions as being used externally (by the users of the library) (without always writing a dummy test)? Or do I simply need to disable the inspection for these functions? Example
    j
    • 2
    • 2
  • j

    Jolan Rensen [JB]

    01/21/2023, 3:24 PM
    Hi everyone! I was looking for a way to be able to change KDocs at compile-time such that changes appear in the sources.jar as well as potentially a javadoc.jar or HTML Dokka site. Existing solutions only worked for the latter and since there exists no such thing as a kdoc.jar, changed documentation doesn't always (correctly) show up when a user is working with your open source library. Introducing my KDoc / JavaDoc Preprocessor Gradle Plugin! This plugin acts as a preprocessor on your sources, allowing you to create new sources from your own with modified KDoc/JavaDocs. The plugin contains a couple of default processors, but is also extensible to include your own! Examples include: •
    @include
    tag to include other comments into your KDoc / JavaDoc, see @include Processor (
    INCLUDE_DOC_PROCESSOR
    ) •
    @sample
    /
    @sampleNoComments
    tag to include code samples into your KDoc / JavaDoc (
    SAMPLE_DOC_PROCESSOR
    ) • A processor that removes all KDoc / JavaDoc comments (
    NO_DOC_PROCESSOR
    ) • A processor that adds a
    /** TODO */
    comment wherever there is no KDoc / JavaDoc comment (
    TODO_DOC_PROCESSOR
    ) • A processor that makes all KDoc / JavaDoc comments uppercase (try and make this for fun!) • The sky is the limit :) Note that this first release is still an early Alpha, but I'm welcome to feedback, bugs, your own processors and whatnot :)
  • g

    George

    01/25/2023, 3:13 PM
    Hi folks, after reading this Programming with assertions it got me thinking if i should also program like that my library. What's your input/review/pov on this? Side note: From the official libraries kotlin-team provides kotlinx.coroutines seems to follow this technique but not kotlinx.serialization. Wondering what was the decisions behind this to include or not assertions.
    r
    • 2
    • 2
  • a

    Alina Dolgikh [JB]

    02/09/2023, 8:35 AM
    📣 Hi everyone! We’re conducting our regular survey on library authors’ experience. If you’re an author of a published Kotlin library or working on one now, please share your feedback. Take the survey: https://surveys.jetbrains.com/s3/kotlin-libs-authors-survey 🎁 You will also have the chance to win 1 out of 5 one-year JetBrains All Products Pack subscription or a $100 Amazon certificate.
  • w

    wrongwrong

    02/09/2023, 4:39 PM
    Hello. Does anyone (especially Mr. @udalov) know what I should implement to access
    org.jetbrains.kotlin.metadata.deserialization
    ? I am developing a project to rewrite `jackson-module-kotlin` with `kotlinx-metadata-jvm` and I noticed that the initialization process of
    KmClass
    is slow. It can't simply compare them because the processes are different, but a benchmark on initialization shows that the content under development takes about 1.2 times longer than the original (comparison on
    o.w.ser.T_20Props.call
    ). https://github.com/ProjectMapK/jackson-module-kogera/pull/63 I looked at the profile of this process and found that most of it was the initialization process of
    KmClass
    . I think this difference is caused by
    KmClass
    reading all the information at once during initialization. The
    KClassImpl
    seems to lazily initialize only the information it needs. So I tried to create a
    LazyKmClass
    that lazily initializes only the necessary information, referring to
    kotlinx.metadata.internal.ProtoBuf.Class.accept
    . However, I am currently stuck because I can't figure out how to access
    org.jetbrains.kotlin.metadata.data.deserialization.protoTypeTableUtil
    . Any help would be greatly appreciated.
    u
    • 2
    • 4
  • r

    remco

    02/13/2023, 1:28 PM
    Hi all, does anyone know where I can find official documentation for Kotlin's public API mode? There's various unofficial guides, a KEEP and it is referenced in some release notes, but I can't seem to find a official documentation page.
    z
    i
    • 3
    • 4
  • a

    Alina Dolgikh [JB]

    02/23/2023, 9:17 AM
    📣 Call to Action. Hi everyone! The survey is still ongoing and your feedback will help us advance the support initiatives of our library authors. If you haven’t already done so, please complete the survey. https://kotlinlang.slack.com/archives/C8C4JTXR7/p1675931708670469
  • h

    Hylke Bron

    02/28/2023, 8:22 AM
    I have explicitApi mode enabled in my multiplatform library. It correctly enforces the visibility modifiers and return types for the common and ios sourcesets, but for the android sourceset it does not work, neither in the IDE and during compilation. Any ideas?
    t
    • 2
    • 4
  • m

    Marcus Cvjeticanin

    03/05/2023, 11:17 AM
    Does anyone have a take on what are good practices while writing an SDK in Kotlin? My SDK will need to work great with Java and this is my first time writing one so just if you have some points that I need to consider while writing it. Have someone done that from this channel?
    b
    m
    l
    • 4
    • 21
  • s

    simon.vergauwen

    03/07/2023, 6:26 PM
    Maybe someone here can shed more light on this? https://kotlinlang.slack.com/archives/C7L3JB43G/p1678126163957399
    b
    f
    • 3
    • 9
  • m

    Marcus Cvjeticanin

    03/13/2023, 8:52 PM
    If I have one project with the structure as following:
    org.myorg.sdk.http
    And then I have another project that have:
    org.myorg.api
    Could there be some conflict if I import that first one as
    implementation("org.myorg.sdk:http:0.1.0")
    I believe there might be something like that since when I implement it, I can't import it since it probably thinks it's in the same project but on a different path? I get the error: "Unresolved reference: sdk" How can fix this?
    k
    • 2
    • 28
  • r

    rkeazor

    03/18/2023, 5:32 PM
    Hey , what are some good techniques to avoid Binary Compatibility issues
    e
    • 2
    • 4
  • m

    Marcus Cvjeticanin

    03/22/2023, 9:41 AM
    Is there a library that implements the IPFS protocol in Kotlin?
Powered by Linen
Title
m

Marcus Cvjeticanin

03/22/2023, 9:41 AM
Is there a library that implements the IPFS protocol in Kotlin?
View count: 3