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

    Anton Afanasev

    06/07/2021, 4:55 PM
    Are there any mock library that supports multiplatform(jvm/native), or any plans to release one?
    c
    b
    c
    • 4
    • 4
  • a

    andylamax

    06/07/2021, 6:09 PM
    Hello everyone, I am trying to generate Multiplatform code at build time. can KSP do this? or do I need to dive into Compiler Plugins?
    d
    d
    +2
    • 5
    • 13
  • d

    Daan Panis

    06/07/2021, 6:56 PM
    Hi guys, I have ktor set up in my kmm project, and was wondering how I could make my API urls configurable, since I want to use a different api url for development compared to when I'm building the app for production. Any tips on how to achieve this?
    m
    x
    • 3
    • 2
  • w

    wbertan

    06/08/2021, 9:00 AM
    Hello, just updated to latest
    Android Studio Bumblebee | 2021.1.1 Canary 2
    And it seems the KMM Plugin isn’t compatible 😞 Do we have anything in the roadmap when a new compatible version of the plugin will be available?
    Plugin 'Kotlin Multiplatform Mobile' (version '0.2.5(203-1.5.10-829-IJ)-120') is not compatible with the current version of the IDE, because it requires build 203.* or older but the current build is AI-211.6222.4
    👀 4
    d
    o
    • 3
    • 7
  • e

    Elyes Ben Salah

    06/08/2021, 10:53 AM
    the use case is to add additional header for each request executed, let’s say Authentication but with a custom header key
    p
    m
    • 3
    • 3
  • d

    divyanshunegi

    06/08/2021, 4:34 PM
    Hi Everyone, I have a project in Android and iOS with 15 local dependencies, in Android we use modules which are part of the project and in iOS we use Swift package manager. we have a
    core-library
    in both android and iOS, we want to convert this into a KMM module and use the same on both iOS and Android as our journey of migration to KMM. as currently I saw we can only import as
    .jar
    in Android and
    .framework
    in iOS, is this true or can we have the complete module added to our project ?
    b
    p
    • 3
    • 5
  • s

    Slackbot

    06/08/2021, 5:09 PM
    This message was deleted.
    m
    a
    d
    • 4
    • 3
  • s

    Saiedmomen

    06/08/2021, 8:15 PM
    Is there a way to use viewmodel defined in common code with Hilt? It needs a @HiltViewModel on class and @inject on constructor.
    j
    k
    +2
    • 5
    • 19
  • g

    Goth

    06/09/2021, 2:34 AM
    Hi Everyone, we are using "native-mt" version of coroutines for our Kotin/Native ARM. On the kotlin doc, it mentions "native-mt" has memory leaks. Has it been fixed in "1.5.0" coroutines? I also see that "ktor" always uses "native-mt" version for kotlix.coroutines.
    🇳🇴 2
    r
    • 2
    • 1
  • j

    jush

    06/09/2021, 6:50 AM
    I followed the "Create a custom compilation" to add a new
    jvm
    custom compilation. It's not clear to me how can I add that new custom compilation as dependency in another module. More details in 🧵
    r
    • 2
    • 4
  • d

    divyanshunegi

    06/09/2021, 7:56 AM
    I am adding latest ktor version 1.6.0 and its not being recognised in my KMM project, 1.4.0 is working fine, what could be the issue, anyone else faced this issue ?
    g
    k
    • 3
    • 9
  • d

    deviant

    06/09/2021, 8:23 AM
    hey guys, what is the best way to fix red gradle configs in kmm project? apart from cache clean/rebuild/cleaning build dirs (because it didn't help). it builds fine, but these highlightings are annoying
    👍 1
    o
    • 2
    • 3
  • r

    rudolf.hladik

    06/09/2021, 4:50 PM
    Hi everyone, is there a way to modify generated swift name of Kotlin class? the usecase is I have a
    open class SomeOpenClass
    in my library named e.g.
    MyKmmLibrary
    if the user use it in the kmm app the open class will have the swift name
    MyKmmLibrarySomeOpenClass
    which is terrible, is there a way to force it to be named just
    SomeOpenClass
    ?
    k
    e
    +2
    • 5
    • 8
  • w

    william

    06/09/2021, 7:57 PM
    does anyone use ktor server in a multiplatform environment? i know the CIO client is able to work like that, not sure about the server. also asked in #ktor
    d
    c
    • 3
    • 2
  • a

    Akram Bensalem

    06/10/2021, 4:03 PM
    Hello, Today I update the KMM plugin and the android studio And retry again to build a new KMM project. The project build and it works great (this is the first time that the default kmm project build successfully from the beginning ♥️) But I have a problem is that I don't have macOS and I want to modify the iOS UI code How to achieve this using windows ?!
    b
    l
    j
    • 4
    • 3
  • a

    aiidziis

    06/10/2021, 7:03 PM
    Hey! Does someone know where https://github.com/touchlab/SQLiter is hosted now?
    ✅ 1
    r
    • 2
    • 3
  • c

    Colton Idle

    06/10/2021, 8:05 PM
    Anyone using Android Studio Bumblebee C2 and KMM plugin? Just created a new project with it and can't get the ios app to run.
    k
    • 2
    • 2
  • a

    Alberto

    06/10/2021, 9:43 PM
    Hello, is the Jackson library supported on KMP projects? If not, is there any guide helping with the conversion of a Java based Jackson project to Kotlin / Kotlinx Serialization?
    m
    r
    • 3
    • 3
  • s

    Slackbot

    06/11/2021, 8:47 AM
    This message was deleted.
    j
    k
    • 3
    • 4
  • d

    divyanshunegi

    06/11/2021, 11:36 AM
    HI,
    public class HeaderInterceptor implements Interceptor {
    
        @Override
        public Response intercept(Chain chain) throws IOException {
            Request request = chain.request();
    
            request = request.newBuilder()
                    .addHeader("headerKey0", "HeaderVal0")
                    .addHeader("headerKey0", "HeaderVal0--NotReplaced/NorUpdated") //new header added
                    .build();
    
            //alternative
            Headers moreHeaders = request.headers().newBuilder()
                    .add("headerKey1", "HeaderVal1")
                    .add("headerKey2", "HeaderVal2")
                    .set("headerKey2", "HeaderVal2--UpdatedHere") // existing header UPDATED if available, else added.
                    .add("headerKey3", "HeaderKey3")
                    .add("headerLine4 : headerLine4Val") //line with `:`, spaces doesn't matter.
                    .removeAll("headerKey3") //Oops, remove this.
                    .build();
    
            request = request.newBuilder().headers(moreHeaders).build();
    
            /* ##### List of headers ##### */
            // headerKey0: HeaderVal0
            // headerKey0: HeaderVal0--NotReplaced/NorUpdated
            // headerKey1: HeaderVal1
            // headerKey2: HeaderVal2--UpdatedHere
            // headerLine4: headerLine4Val
    
            Response response = chain.proceed(request);
            return response;
        }
    }
    I have something like this custom Interceptor in my Android retrofit interceptor for headers, I am converting this logic to ktor and want add an interceptor there, I could not find a proper solution, the way ktor docs suggest is we need to create a custom feature (Plugin) and install it while instantiating the client, any help or direction is appreciated
    m
    • 2
    • 3
  • j

    Jim

    06/11/2021, 6:04 PM
    I need to log the screen size of my iOS device.
    UIScreen.mainScreen.bounds.size
    bounds
    should be a
    CGRect
    and
    size
    should be a
    CGSize
    , but
    size
    is an
    Int
    . This seems like a bug. Any other ways to get the screen size?
    m
    • 2
    • 2
  • d

    divyanshunegi

    06/12/2021, 10:14 AM
    This might sound a noob question but just starting on KMM, I want to create an APIClient as shared module for Android and iOS I need the following features • It should have local SSL data encryption • InternetConnectionCheck Interceptor • ErrorHandlerInterceptor • RetryRequest After RefreshToken Interceptor • Few other custom interceptors Earlier I was writing my APiClient in the
    commonMain
    but as I can see it does not support addInterceptor property by default, which is available in OkHttp for Android. So the new plan I had is create an expect class APiClient in common main and implement APIClient for Android on AndroidMain with OkHttp engine and APiClient on iOSMain with IOS Engine. Is this approach right ? or am I missing some part ?
    👍 1
    c
    r
    • 3
    • 9
  • e

    elye

    06/14/2021, 10:27 AM
    Anyone know how I can get to use GsonSerializer for ktor? https://stackoverflow.com/questions/67968603/how-to-get-to-use-gsonserializer-for-ktor
    r
    • 2
    • 4
  • e

    elye

    06/14/2021, 11:40 AM
    While trying with KMM Tutorial

    https://www.youtube.com/watch?v=_Q62iJoNOfg▾

    , but with slightly different model… I got the below error when performing deserialization for iOS (okay in Android though). https://stackoverflow.com/questions/67969562/kotlin-native-concurrent-invalidmutabilityexception-mutation-attempt-of-frozen Any idea what cause the problem? Or is the a Kotlin-Native bug?
    b
    r
    • 3
    • 4
  • n

    Nicolas Demoisson

    06/14/2021, 12:33 PM
    I am using kotlin multiplatform v1.5.10 to build binaries for Android and iOS. I have 2 kotlin native project (a core and a client). In the core project I have a singleton (using kotlin 'object' with threadlocal annotation), which is find in the client. The problem is at the client export to Apple Framework via cocoapods plugin (v1.5.10) this singleton present in core seems not being exported and is not reachable through xcode. The module is well exported and other class are visible. I guess it's because the singleton is kind of declared as unused. Do you know how I could tell cocoapods plug-in to keep this singleton or to not remove unused code ? Many thks
    m
    r
    • 3
    • 14
  • h

    Henry

    06/15/2021, 2:03 AM
    Our model has multi fields with multiple name, I want to use multi serial name, but I can not, any way to do that? thank alot
    m
    • 2
    • 1
  • n

    Napa Ram

    06/15/2021, 7:00 AM
    • org.jetbrains.kotlin.backend.common.BackendException: Backend Internal error: Exception during IR lowering File being compiled: /home/user/napa.ram/AndroidStudioProjects/practise/Application-Details-KMM/shared/src/commonMain/kotlin/com/iexceed/applicationdetailskmm/personaldetails/data/source/local/PersonaldetailsDao.kt The root cause java.lang.AssertionError was thrown at: org.jetbrains.kotlin.ir.expressions.IrMemberAccessExpressionKt.throwNoSuchArgumentSlotException(IrMemberAccessExpression.kt:66) at org.jetbrains.kotlin.backend.common.CodegenUtil.reportBackendException(CodegenUtil.kt:239) at org.jetbrains.kotlin.backend.common.CodegenUtil.reportBackendException$default(CodegenUtil.kt:235) at org.jetbrains.kotlin.backend.common.phaser.PerformByIrFilePhase.invoke(PhaseBuilders.kt:124) at org.jetbrains.kotlin.backend.common.phaser.PerformByIrFilePhase.invoke(PhaseBuilders.kt:112) at org.jetbrains.kotlin.backend.common.phaser.NamedCompilerPhase.invoke(CompilerPhase.kt:94) at org.jetbrains.kotlin.backend.common.phaser.CompositePhase.invoke(PhaseBuilders.kt:30) at org.jetbrains.kotlin.backend.common.phaser.NamedCompilerPhase.invoke(CompilerPhase.kt:94) at org.jetbrains.kotlin.backend.common.phaser.CompilerPhaseKt.invokeToplevel(CompilerPhase.kt:41) at org.jetbrains.kotlin.backend.jvm.JvmLower.lower(JvmLower.kt:407) at org.jetbrains.kotlin.backend.jvm.JvmIrCodegenFactory.doGenerateFilesInternal$backend_jvm(JvmIrCodegenFactory.kt:147) at org.jetbrains.kotlin.backend.jvm.JvmIrCodegenFactory.generateModule(JvmIrCodegenFactory.kt:120) at org.jetbrains.kotlin.codegen.KotlinCodegenFacade.compileCorrectFiles(KotlinCodegenFacade.java:35) at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.generate(KotlinToJVMBytecodeCompiler.kt:595) at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:211) at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli$default(KotlinToJVMBytecodeCompiler.kt:154) at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:169) at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:52) at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:88) at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:44) at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:98) at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:386) at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:110) at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileIncrementally(IncrementalCompilerRunner.kt:286) at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileImpl$rebuild(IncrementalCompilerRunner.kt:99) at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileImpl(IncrementalCompilerRunner.kt:114) at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compile(IncrementalCompilerRunner.kt:74) at org.jetbrains.kotlin.daemon.CompileServiceImplBase.execIncrementalCompiler(CompileServiceImpl.kt:607) at org.jetbrains.kotlin.daemon.CompileServiceImplBase.access$execIncrementalCompiler(CompileServiceImpl.kt:96) at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1659) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359) at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200) at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196) at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:562) at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:796) at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:677) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:676) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) Caused by: java.lang.AssertionError: No such value argument slot in IrConstructorCallImpl: 0 (total=0). Symbol: public com.iexceed.applicationdetailskmm.personaldetails.data.source.local/PersonaldetailsDao.|1280618353163213788[0] at org.jetbrains.kotlin.ir.expressions.IrMemberAccessExpressionKt.throwNoSuchArgumentSlotException(IrMemberAccessExpression.kt:66) at org.jetbrains.kotlin.ir.expressions.IrFunctionAccessExpression.getValueArgument(IrFunctionAccessExpression.kt:24) at org.jetbrains.kotlin.backend.common.lower.DefaultParameterInjector.parametersForCall(DefaultArgumentStubGenerator.kt:407) at org.jetbrains.kotlin.backend.common.lower.DefaultParameterInjector.visitFunctionAccessExpression(DefaultArgumentStubGenerator.kt:299) at org.jetbrains.kotlin.backend.common.lower.DefaultParameterInjector.visitConstructorCall(DefaultArgumentStubGenerator.kt:336) at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitConstructorCall(IrElementTransformerVoid.kt:202) at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitConstructorCall(IrElementTransformerVoid.kt:24) at org.jetbrains.kotlin.ir.expressions.impl.IrConstructorCallImpl.accept(IrConstructorCallImpl.kt:28) at org.jetbrains.kotlin.ir.expressions.IrExpression.transform(IrExpression.kt:33) at org.jetbrains.kotlin.ir.expressions.impl.IrReturnImpl.transformChildren(IrReturnImpl.kt:41) at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitExpression(IrElementTransformerVoid.kt:131) at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitReturn(IrElementTransformerVoid.kt:292) at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitReturn(IrElementTransformerVoid.kt:293) at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitReturn(IrElementTransformerVoid.kt:24) at org.jetbrains.kotlin.ir.expressions.impl.IrReturnImpl.accept(IrReturnImpl.kt:34) at org.jetbrains.kotlin.ir.expressions.IrExpression.transform(IrExpression.kt:33) at org.jetbrains.kotlin.ir.expressions.IrExpression.transform(IrExpression.kt:26) at org.jetbrains.kotlin.ir.expressions.IrBlockBody.transformChildren(IrBody.kt:62) at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoidKt.transformChildrenVoid(IrElementTransformerVoid.kt:330) at org.jetbrains.kotlin.backend.common.lower.DefaultParameterInjector.lower(DefaultArgumentStubGenerator.kt:291) at org.jetbrains.kotlin.backend.common.BodyLoweringVisitor$visitBody$1.invoke(Lower.kt:155) at org.jetbrains.kotlin.backend.common.BodyLoweringVisitor$visitBody$1.invoke(Lower.kt:154) at org.jetbrains.kotlin.ir.declarations.StageController.bodyLowering(PersistentApi.kt:29) at org.jetbrains.kotlin.backend.common.BodyLoweringVisitor.visitBody(Lower.kt:154) at org.jetbrains.kotlin.backend.common.BodyLoweringVisitor.visitBody(Lower.kt:130) at org.jetbrains.kotlin.ir.visitors.IrElementVisitor$DefaultImpls.visitBlockBody(IrElementVisitor.kt:48) at org.jetbrains.kotlin.backend.common.BodyLoweringVisitor.visitBlockBody(Lower.kt:130) at org.jetbrains.kotlin.backend.common.BodyLoweringVisitor.visitBlockBody(Lower.kt:130) at org.jetbrains.kotlin.ir.expressions.IrBlockBody.accept(IrBody.kt:54) at org.jetbrains.kotlin.ir.declarations.IrFunction.acceptChildren(IrFunction.kt:61) at org.jetbrains.kotlin.backend.common.BodyLoweringVisitor.visitDeclaration(Lower.kt:140) at org.jetbrains.kotlin.backend.common.BodyLoweringVisitor.visitDeclaration(Lower.kt:130) at org.jetbrains.kotlin.ir.visitors.IrElementVisitor$DefaultImpls.visitFunction(IrElementVisitor.kt:33) at org.jetbrains.kotlin.backend.common.BodyLoweringVisitor.visitFunction(Lower.kt:130) at org.jetbrains.kotlin.backend.common.BodyLoweringVisitor.visitFunction(Lower.kt:130) at org.jetbrains.kotlin.ir.visitors.IrElementVisitor$DefaultImpls.visitSimpleFunction(IrElementVisitor.kt:34) at org.jetbrains.kotlin.backend.common.BodyLoweringVisitor.visitSimpleFunction(Lower.kt:130) at org.jetbrains.kotlin.backend.common.BodyLoweringVisitor.visitSimpleFunction(Lower.kt:130) at org.jetbrains.kotlin.ir.declarations.IrSimpleFunction.accept(IrSimpleFunction.kt:28) at org.jetbrains.kotlin.backend.common.BodyLoweringVisitor.visitClass(Lower.kt:146) at org.jetbrains.kotlin.backend.common.BodyLoweringVisitor.visitClass(Lower.kt:130) at org.jetbrains.kotlin.ir.declarations.IrClass.accept(IrClass.kt:55) at org.jetbrains.kotlin.backend.common.BodyLoweringVisitor.visitClass(Lower.kt:146) at org.jetbrains.kotlin.backend.common.BodyLoweringVisitor.visitClass(Lower.kt:130) at org.jetbrains.kotlin.ir.declarations.IrClass.accept(IrClass.kt:55) at org.jetbrains.kotlin.backend.common.LowerKt.runOnFilePostfix(Lower.kt:126) at org.jetbrains.kotlin.backend.common.LowerKt.runOnFilePostfix$default(Lower.kt:119) at org.jetbrains.kotlin.backend.common.BodyLoweringPass$DefaultImpls.lower(Lower.kt:62) at org.jetbrains.kotlin.backend.common.lower.DefaultParameterInjector.lower(DefaultArgumentStubGenerator.kt:283) at org.jetbrains.kotlin.backend.common.phaser.FileLoweringPhaseAdapter.invoke(PhaseBuilders.kt:155) at org.jetbrains.kotlin.backend.common.phaser.FileLoweringPhaseAdapter.invoke(PhaseBuilders.kt:151) at org.jetbrains.kotlin.backend.common.phaser.NamedCompilerPhase.invoke(CompilerPhase.kt:94) at org.jetbrains.kotlin.backend.common.phaser.PerformByIrFilePhase.invoke(PhaseBuilders.kt:121) ... 43 more
    :thread-please: 7
    g
    a
    • 3
    • 2
  • h

    Hossein Amini

    06/15/2021, 11:11 AM
    Hello, in android projects I always create a Java/Kotlin module for the domain layer and I add it to the data layer(which is an Android module) . Now I want to do this process for a KMM project but when I create a Java/Kotlin module and add it to the shared module (commonMain) the iOS app won’t be built. Please guid me. Thanks
    o
    • 2
    • 1
  • c

    Carson Holzheimer

    06/15/2021, 11:25 AM
    Repo and CD Strategy I saw some talks about this over a year ago, but I'm wondering if more of a best practice has been discovered since. I would like to know the best way to structure a repo for a new shared module that will be accessed by 2 existing native apps. One Android, one iOS. This is my current plan: Store it in the android repo. To build for iOS, pull down the android repo, and set the folder path to the common build script. For CD, publish the pod to a private repo (with it's own versioning an release process) and adjust the location of the pod for the CD build.
    b
    • 2
    • 13
  • s

    stillping

    06/15/2021, 2:49 PM
    We are attempting to integrate a native iOS/tvOS package that’s been packaged as a full 
    .xcframework
     into a KMP project Is there any built-in way of consuming these things in KMP?  If not, is there a Gradle plugin for this?
    👍 2
    m
    • 2
    • 2
Powered by Linen
Title
s

stillping

06/15/2021, 2:49 PM
We are attempting to integrate a native iOS/tvOS package that’s been packaged as a full 
.xcframework
 into a KMP project Is there any built-in way of consuming these things in KMP?  If not, is there a Gradle plugin for this?
👍 2
m

mkrussel

06/15/2021, 5:06 PM
I don't know of any built in way to do it. But and
.xcframework
contains architecture directories containing normal frameworks. You need to make the cinterop point to the correct directory based on the target.
s

stillping

06/16/2021, 7:45 AM
Thanks @mkrussel! It seems this approach works perfectly… Lots of string manipulation based on each target but it does the job.
View count: 2