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
multiplatform
  • x

    xiaobailong24

    07/25/2022, 10:01 AM
    Hello folks, has anyone got this issue in new MM? https://youtrack.jetbrains.com/issue/KT-53316
  • a

    Andy Wu

    07/25/2022, 1:20 PM
    I am testing out KMM, and having a KMM library connecting to a grpc service on hosting machine. I then have a simple test in
    commonTest
    , trying to make the connection to the service. I then run the test from AS, choosing
    Android
    as the target. However, I simply cannot make it work: If I use
    localhost
    as the destination host, I get a connection rejection error. Then I thought maybe this is running from Android emulator, so I use
    10.0.2.2
    . This gives me
    Operation timed out
    error. So, what is the right way to connect to a service on the host OS from KMM test targeting Android?
    • 1
    • 1
  • d

    darkmoon_uk

    07/25/2022, 1:43 PM
    I find when developing :compose-multiplatform: Compose/ :kotlinnew: Multi-Platform code I switch between [JB] IDE's frequently. This code to auto-select the Android Gradle Plugin version has become a significant time-saver 😄 🎁 Welcome to copy; or... would you even find this useful as a Gradle plugin? Perhaps pointing to some kind of centrally updated IDE/AGP version map? (This would go in top-level
    build.gradle.kts
    )
    Auto-select_Android_Gradle_Plugin.txt
    e
    • 2
    • 2
  • a

    Alejandro Rios

    07/25/2022, 4:12 PM
    Hello, does anyone have a repo sample of a KMM project with each project separately?
    j
    • 2
    • 11
  • f

    Francis Mariano

    07/25/2022, 6:59 PM
    Hello everyone. Is it possible to check what is the applicationId or flavor name (android) in the shared code???
    l
    • 2
    • 2
  • d

    dbreskvar

    07/26/2022, 4:52 AM
    Hey everyone, I’m looking into creating different flavors for common in my KMM project. I’ve setup the commonDev and commonProd but it still reads the api models from commonMain. I’m not sure what I’m doing wrong, or if I’m missing to register the flavors somewhere. I have setup the sourceSets, so they are configured properly and I have android flavors as well. I was thinking about using the buildKonfig library but I’m not sure if it’s going to solve the issue. any help is appreciated 🙏
    c
    • 2
    • 1
  • d

    Davide Giuseppe Farella

    07/26/2022, 12:15 PM
    Hey guys, I have 4 modules: 1.
    app
    plain JVM module + Android ( depends on
    third
    ) 2.
    second
    multiplatform without Android ( depends on
    third
    ) 3.
    third
    multiplatform + Android module ( depends on
    fourth
    ) 4.
    fourth
    fourth
    is supposed to contain Android-only source code, so how should I set it up? Should it be multiplatform + Android or JVM only + Android? I tried some stuff, but I have
    (xxx) Could not resolve project :fourth
    Required by:
    project (yyy)
    *Replace (xxx) with 😒econd:sourceSet and :third:sourceSet and (yyy) with :third and :second > :third
    j
    r
    • 3
    • 35
  • e

    eygraber

    07/26/2022, 2:37 PM
    If I have a function that takes a
    vararg String
    is there any way to have that use a variadic function instead of
    KotlinArray
    on iOS? I imagine no because the vararg is an array, but I'm wondering if anyone has any ideas. My iOS team doesn't want to use
    KotlinArray
    so I'm providing a
    Set<String>
    overload for them, but it's not ideal.
    j
    • 2
    • 3
  • r

    Raymond Chan

    07/26/2022, 5:12 PM
    May be late, but you can try to decompress the .ipa file and show the content of your .app file. I’ve encountered this too due to a wrong Podfile config which cause my framework with binary to be bundled in the same level as the app. But I think for most of the cases, this should be the answer.
  • r

    rkeazor

    07/26/2022, 8:56 PM
    Is there a reason Kmm plugin is not supported by Intelij idea ?
    b
    k
    d
    • 4
    • 4
  • p

    Priyanshu Jain

    07/27/2022, 5:15 AM
    Hey everyone. Just tried KMM for the first time. The build for iOS fails when trying to launch the default project (hello world project) from both Android Studio or XCode. This is the build log:
    BUILD FAILED in 5s
    Command PhaseScriptExecution failed with a nonzero exit code
    ** BUILD FAILED **
    The following build commands failed:
    PhaseScriptExecution Run\ Script /Users/priyanshujain/AndroidStudioProjects/Test/build/ios/iosApp.build/Debug-iphonesimulator/iosApp.build/Script-7555FFB5242A651A00829871.sh (in target 'iosApp' from project 'iosApp')
    (1 failure)
    Can anyone help me with this? Thanks 🙂
    k
    • 2
    • 2
  • a

    abu naser

    07/27/2022, 6:58 AM
    every project including new .. working fine but all the gradle file have this error :Cannot access ‘java.lang.Comparable’ which is a supertype of ‘org.gradle.kotlin.dsl.KotlinBuildScript’. Check your module classpath for missing or conflicting dependencies Cannot access ‘java.lang.Object’ which is a supertype of ‘org.gradle.kotlin.dsl.KotlinBuildScript’. Check your module classpath for missing or conflicting dependencies
    k
    • 2
    • 1
  • s

    Sam

    07/27/2022, 11:22 AM
    Has anyone managed to get a concept of build variants working within the shared code? Specifically my usecase is wanting to define instances of data classes populated with dummy data (for a mock variant of the app) in shared code, but I don't want those to be used in production. Any ideas anyone? 🙏
    d
    l
    +2
    • 5
    • 13
  • i

    Ian Alexander

    07/27/2022, 4:06 PM
    I'm trying to create a dagger component in
    jvmMain
    of shared code - with the idea being I want to write E2E tests which use the object graph in shared with Fakes attached. We currently have annotations on all constructors which are real annotations in JVM & Fakeannotations in iOS.
    jvmMain
    actual typealias MakeInjectable = javax.inject.Inject
    commonMain
    class LogInViewModel @MakeInjectable constructor() { ... }
    The problem is, none of the generated dagger code is created - is there something simple I'm missing? Or is this even possible?
    shared/build.gradle
    plugins {
        kotlin("multiplatform")
        ...
        kotlin("kapt")
    }
    
    ...   
         
    val jvmTest by getting {
                dependencies {
                    ...
                    implementation(AndroidLibrary.dagger)
                    compileOnly(AndroidLibrary.daggerCompiler)
                }
            }
  • j

    Jilles van Gurp

    07/27/2022, 7:19 PM
    I'm presenting at the Virtual Kotlin User Group tomorrow. "Full Stack Kotin at FORMATION" . We use Fritz2 and Kotlin-js, Spring Boot, and a whole range of Kotlin multi platform libraries. Including a few that we created. https://www.meetup.com/virtual-kotlin-user-group/events/286992625/?utm_medium=social[…]kedin.company&amp;utm_campaign=postfity&amp;utm_content=postfityea064
  • a

    Ali Khaleqi Yekta

    07/28/2022, 5:45 AM
    I'm trying to use ComposeUI Multiplatform with Kotlin
    1.7.10
    , but the latest version uses
    1.7.0
    . Is there a way to achieve this? I heard about setting the compiler version for Jetpack Compose, I don't know if it is applicable to JB Compose.
    p
    a
    j
    • 4
    • 8
  • m

    Mikhail

    07/28/2022, 8:11 AM
    Am using Kotlin 1.7.10 with Gradle 7.4.1
    a
    e
    • 3
    • 6
  • j

    jessewilson

    07/28/2022, 2:25 PM
    I’m attempting to read a file in a Kotlin multiplatform unit test. I don’t have the absolute path to the file, but I do know it relative to my project directory. When I run the test on JVM or macosArm64, the process' current working directory (CWD) is the project directory so everything is easy. But when I run the test on a simulator, the CWD is
    ~/Library/Developer/CoreSimulator/Devices/C641A553-AA3D-4FAD-4AE-8BDD0E346C5D/data
    . Anyone know of a way to recover the project directory when running a test in a simulator?
    l
    m
    +2
    • 5
    • 14
  • l

    Landry Norris

    07/28/2022, 2:35 PM
    I see that there’s a Qodana image for android. I’m trying to run it in a KMM project, but it looks like Qodana tries to download the K/N compilers and fails.
    Caused by: com.intellij.openapi.externalSystem.model.LocationAwareExternalSystemException: Could not find :kotlin-native-prebuilt-linux-aarch64:1.7.0.                     
    Searched in the following locations:                                                                                                                                       
      - <https://download.jetbrains.com/kotlin/native/builds/releases/1.7.0/linux-aarch64/kotlin-native-prebuilt-linux-aarch64-1.7.0.tar.gz>
    Is there a good way to tell Qodana to ignore K/N, or even better, some way to use Qodana for K/N?
  • x

    xxfast

    07/28/2022, 11:52 PM
    Hi all - Recently migrated to kotlin 1.7.10 with agp 7.2.1 and gradle 7.4.2. Enabled
    import_orphan_source_sets=false
    similar to PeopleInSpace but i'm getting spammed with lots of these
    [sync warning] Source set "androidAndroidTestRelease" is not compiled with any compilation. This source set is not imported in the IDE.
    [sync warning] Source set "androidTestFixtures" is not compiled with any compilation. This source set is not imported in the IDE.
    [sync warning] Source set "androidTestFixturesDebug" is not compiled with any compilation. This source set is not imported in the IDE.
    when i do a sync. Builds just fine but wondering if anyone encountered this? 🤔
    s
    • 2
    • 1
  • m

    Martin Rajniak

    07/29/2022, 9:55 AM
    Hey folks, do you know what are my options to debug this issue with KMM?
    Task 'embedAndSignAppleFrameworkForXcode' not found in project ':ipInfo'.
    Currently it works perfectly on local machines but fails on CI. But I am experiencing this issue every now and then and would like to learn some tricks how to get to the bottom of the issue. Any ideas?
    r
    m
    • 3
    • 12
  • m

    Michal Klimczak

    07/29/2022, 1:04 PM
    Hey guys, remember Koru - library which generates ios wrappers for coroutines? It's now rewritten with KSP and has a compiler plugin for easier setup. Have fun and let me know if there are any issues. https://github.com/FutureMind/koru
    u
    r
    • 3
    • 16
  • d

    Dominaezzz

    07/29/2022, 8:10 PM
    For testing, is there a "before each" or "before all" annotation?
    a
    j
    • 3
    • 3
  • f

    fabianhjr

    07/30/2022, 1:36 AM
    message has been deleted
    m
    • 2
    • 1
  • a

    almibe

    07/31/2022, 6:45 PM
    Hi all, I’m running into an issue with a Kotlin multi-platform/multi-project (is there a better term for that?) gradle build. Most of the sub-projects are common Kotlin code but the one I’m having issues with is JVM only and I’m trying to make it use the gradle application plugin. At first, I tried to just get a simple “Hello, World” application working and I got that working after I realized that besides including the application plugin and configuring the main class I also needed the following:
    tasks.named<JavaExec>("run") {
      dependsOn(tasks.named<Jar>("jvmJar"))
      classpath(tasks.named<Jar>("jvmJar"))
     }
    Now the simple app works when I do
    gradle run
    , but when I depend on code from other sub-projects that are just common code when I run the application I get
    java.lang.NoClassDefFoundError
    exceptions for the classes from the common sub-projects. (
    gradle check
    runs fine btw) I’m assuming this is an issue with how I have the application plugin setup, but I’m not sure what changes need to be made.
    m
    o
    • 3
    • 6
  • x

    xxfast

    08/01/2022, 1:29 AM
    Hi all, I get this in AS run window when i try to run the ios client with the KMM plugin. I can build the ios app from xcode and run just fine
    CoreSimulator.framework was changed while the process was running.  This is not a supported configuration and can occur if <http://Xcode.app|Xcode.app> was updated while the process was running.  Service version (802.6.1) does not match expected service version (802.6).
    • 1
    • 1
  • e

    eygraber

    08/01/2022, 12:41 PM
    If I have multiple variants of a target, how does gradle resolution work? Does the project requesting the artifacts have to use the same variant name?
    r
    • 2
    • 2
  • d

    Dzmitry Petrushenka

    08/01/2022, 4:25 PM
    please ping me 1:1 is you have any clue
  • a

    Anamika Trivedi

    08/01/2022, 7:33 PM
    Are there any known performance issues in Realm Multiplatform vs. SQLDelight?
  • k

    kpgalligan

    08/01/2022, 10:01 PM
    You can use sqlcipher with sqldelight. I’ll send a sample in a bit.
Powered by Linen
Title
k

kpgalligan

08/01/2022, 10:01 PM
You can use sqlcipher with sqldelight. I’ll send a sample in a bit.
View count: 27