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
  • r

    Rohan Maity

    02/27/2022, 7:37 AM
    Hello, Is there any way to generate the framework for for Debug variant I mean I always have to use
    ./gradlew build
    which buids all variant I tried
    ./gradlew buildDebug
    but it does not generate framework for me
    m
    b
    +2
    • 5
    • 17
  • c

    Chachako

    02/27/2022, 6:00 PM
    Hello everyone, how should I interoperate with C++ in the native target of the kotlin-multiplatform? I need to call a library whose header file is C++, the library is a bit huge, so it is unrealistic to manually change it to a C header. In addition, I am a newbie to C/C++, so this question may be a bit stupid.
    b
    g
    • 3
    • 7
  • a

    Adam Brown

    02/27/2022, 8:09 PM
    I've got an annoying problem, so with the latest IntelliJ Ultimate, I create a brand new multiplatform project, compile and run, all works. Then I add a new library to the
    commonMain
    source set, and IntelliJ doesn't seem to know about them. Auto-complete won't recommend them. I Can add the import manually and it's fine, but the IDE doesn't seem to know about it. I have tried invalidate and restart, deleting the
    .idea/
    directory and re-importing the project, doesn't matter. I've also tried on separate computers & OSs (OSX & Windows) and its the same. Is this something anyone else has run into?
    o
    • 2
    • 2
  • a

    Ankit Dubey

    03/01/2022, 6:07 AM
    Hi all, Wondering if we can call API synchronously using Ktor Engine. Actually, whenever I'm getting 401 Authorization Token Expired error, I've to call Login API implicitly from Authenticator. Now this api call need to be called synchronously as after getting login API response, i've to update the header with Auth Token and return the request again from authenticate method.
    Update : I was not aware of ktor-client-auth, let me check if it'll help me.
    Thanks
    g
    • 2
    • 8
  • y

    ynsok

    03/01/2022, 7:01 AM
    Hi, I Have a .json file that is placed in scr/commonMain/resources, while I would like to start desktop tasks [run], [assemble], [build], I’ve received an error that this file doesn’t exist. If I’m doing this for android everything is working correctly. Is there a way to solve it ?
    g
    d
    • 3
    • 4
  • s

    Simon BRUNOU

    03/01/2022, 9:19 AM
    Hi all, I was wondering what are the best practices for versioning a KMM application. I'm the only mobile developer in our company and I'm trying to share most of the code with KMM, however I will not be able to work on the Android and iOS app at the same time. My question is: how do I tag my releases? Do I tag the android app with, for instance, android-1.0.0 and iOS with iOS-1.0.0 afterwards? Is there any better way to do it? Maybe I should publish the shared library in a maven repository and a Cocoapods repository and use it in separate projects? I struggle to find some examples and best practices for this case.
    a
    • 2
    • 2
  • v

    Vivek Modi

    03/01/2022, 12:22 PM
    Hey I am new in the world of Kotlin Multiplatform mobile. I have experience in development of android field. I am trying to connect Android application and Ios application. I searched and see Ktor is the way to fetch data from server. In android we use Kotlin Sealed Classes for Handling API Responses example in your application and in ios side team use Understanding Swift closures and asynchronous request functions similar to these. I am little bit confused, How can I use this way in common module to use both platform because both platform have Interceptor and many more things. Do I need to write everything from scratch? or Is there any way we can use existing way. My both platforms application is huge project. I don't won't to replace the code. I want to start new api call throught KMM. Any suggestion would be helpful for me. Thanks
    g
    • 2
    • 8
  • p

    pererikbergman

    03/01/2022, 2:47 PM
    Hey all, it's been a few months since I setup a KMM project for testing, we are getting closer to project start time so I decided to set it up again just to refresh my memory and to potentially update the libs etc. I added the sqldelight and the kotlinx-serialization-core, I get this error in sync:
    Could not resolve org.jetbrains.kotlinx:kotlinx-serialization-core:1.2.2
    if I build it works for Android, but it doesn't work on iOS. I get this error:
    The following build commands failed:
    	PhaseScriptExecution [CP-User]\ Build\ shared ... (in target 'shared' from project 'Pods')
    I am using CocooaPods if that are in interests here, I am a bit confused and not sure were I should look now, any ideas?
    a
    • 2
    • 5
  • m

    Matti MK

    03/01/2022, 5:39 PM
    Any tips on handling how to show licenses of 3rd party libs used in KMM module? Normally I’d use
    CocoaPods Acknowledgements
    and
    oss-licenses
    , but I’m a bit doubtful that either one would work in this scenario… or at least the
    CocoaPods
    one
    • 1
    • 1
  • m

    Matthew Kruk

    03/01/2022, 9:09 PM
    Hello, I'm trying to build a kmm library for android and iOs that includes a webview. Does this work for iOS or macOS/other native only?:
    import kotlinx.cinterop.*
    import platform.WebKit.*
    import platform.Foundation.NSZeroRect
    
    class myWebView : WKWebView(frame = NSZeroRect.readValue(), configuration = WKWebViewConfiguration())
    • 1
    • 1
  • r

    r

    03/02/2022, 2:51 AM
    Hello! I'm building a multiplatform project targeting ios, android, jvm, and eventually js. The idea is to create a multiplatform library with the network layer and some business logic in it that I can share across my different projects. I also want to share this library with a desktop compose app I'm starting to create. I'm looking for a decent (or suggested) library to do DI in the multiplatform library. So far, I've found that Koin and Kodein have support for multiplatform. Is there a preferred library for DI on KMM? Do you prefer one over the other? why? thanks in advance.
    e
    j
    +3
    • 6
    • 27
  • x

    xxfast

    03/02/2022, 3:06 AM
    Hi guys, are there any multiplatform location libraries available ?
    e
    • 2
    • 4
  • k

    khairil.ushan

    03/02/2022, 12:22 PM
    Hello everyone. I have a KMM app, the iOS project is able to consume functionalities from the shared module. Now I’m trying to add Swift Package into my iOS project. Can I make my swift package also recognize the shared module ?
    h
    a
    • 3
    • 8
  • m

    Marc Reichelt

    03/02/2022, 4:15 PM
    Hey there! In our project, I noticed that classes like
    com.foo.SomeClass
    will be exported in iOS with Swift names
    SomeClass
    . If our module exports a lot of those, and all the swift files import the module with
    import SharedCode
    , there might be some conflicting Swift classes or classes from other libraries. Does anyone have a good solution for this? Something like a namespace, or exporting multiple swift packages, or other approaches?
    a
    • 2
    • 4
  • s

    Scott Kruse

    03/02/2022, 9:51 PM
    Is there currently a way to export iOS build artifact directly to swift package manager?
    h
    • 2
    • 1
  • v

    Vivek Modi

    03/03/2022, 12:15 AM
    Hey I am learning Kmm with cocoapods integration. My studio is generated podfile automatically when I added the KMM module. Sometag I understand but some are not. Can someone guide me use case of attributes and also did I miss any attributes for my ios project. Podile
    ​Pod​::​Spec​.​new​ ​do​ |​spec​| 
     ​    ​spec​.​name​                     ​=​ ​'kotlinmultiplatformsharedmodule' 
     ​    ​spec​.​version​                  ​=​ ​'1.0' 
     ​    ​spec​.​homepage​                 ​=​ ​'<https://github.com/vivek-modi/MultiplatformProject|https://github.com/vivek-modi/MultiplatformProject>' 
     ​    ​spec​.​source​                   ​=​ ​{​ ​:git​ ​=>​ ​"Not Published"​,​ ​:tag​ ​=>​ ​"Cocoapods/​#{​spec​.​name​}​/​#{​spec​.​version​}​"​ ​} 
     ​    ​spec​.​authors​                  ​=​ ​'<mailto:vivekmodi456@gmail.com|vivekmodi456@gmail.com>' 
     ​    ​spec​.​license​                  ​=​ ​'' 
     ​    ​spec​.​summary​                  ​=​ ​'Some description for the Shared Module' 
      
     ​    ​spec​.​vendored_frameworks​      ​=​ ​"build/cocoapods/framework/kotlinmultiplatformsharedmodule.framework" 
     ​    ​spec​.​libraries​                ​=​ ​"c++" 
     ​    ​spec​.​module_name​              ​=​ ​"​#{​spec​.​name​}​_umbrella" 
      
     ​    ​spec​.​ios​.​deployment_target​ ​=​ ​'14.1' 
      
     ​    ​spec​.​pod_target_xcconfig​ ​=​ ​{ 
     ​        ​'KOTLIN_PROJECT_PATH'​ ​=>​ ​':app:kotlinmultiplatformsharedmodule'​, 
     ​        ​'PRODUCT_MODULE_NAME'​ ​=>​ ​'kotlinmultiplatformsharedmodule'​, 
     ​    ​} 
      
     ​    ​spec​.​script_phases​ ​=​ ​[ 
     ​        ​{ 
     ​            ​:name​ ​=>​ ​'Build kotlinmultiplatformsharedmodule'​, 
     ​            ​:execution_position​ ​=>​ ​:before_compile​, 
     ​            ​:shell_path​ ​=>​ ​'/bin/sh'​, 
     ​            ​:script​ ​=>​ ​<<-SCRIPT 
     ​                if [ "YES" = "$COCOAPODS_SKIP_KOTLIN_BUILD" ]; then 
     ​                  echo "Skipping Gradle build task invocation due to COCOAPODS_SKIP_KOTLIN_BUILD environment variable set to ​\"​YES​\"​" 
     ​                  exit 0 
     ​                fi 
     ​                set -ev 
     ​                REPO_ROOT="$PODS_TARGET_SRCROOT" 
     ​                "$REPO_ROOT/../../gradlew" -p "$REPO_ROOT" $KOTLIN_PROJECT_PATH:syncFramework ​\ 
     ​                    -Pkotlin.native.cocoapods.platform=$PLATFORM_NAME ​\ 
     ​                    -Pkotlin.native.cocoapods.archs="$ARCHS" ​\ 
     ​                    -Pkotlin.native.cocoapods.configuration=$CONFIGURATION 
     ​            SCRIPT 
     ​        ​} 
     ​    ​] 
     ​end
    1. I have doubt in source, vendored_framework, libraries, module_name and what is pod_tarvet_xconfig. 2. Did I miss any other attributes for my ios project? 3. Can someone explain me how this pod is know where the framework is? If I add this pod file to different repository so how can I connect them
    🧵 1
    :google: 1
    a
    • 2
    • 10
  • g

    George

    03/03/2022, 11:35 AM
    Hi folks, quick question. How come i can import java.util.UUID in commonMain? In commonMain:
    public expect class UUID
    In jvmMain
    public actual typealias UUID = java.util.UUID
    In another part in commonMain:
    import java.util.UUID
    
    public data class Account(
        public val uuid: UUID,
        public val number: String,
        public val firstName: String,
        public val lastName: String,
        public val identityKey: String
    )
    g
    • 2
    • 7
  • s

    spierce7

    03/03/2022, 7:59 PM
    What are the plans for Kotlin and multiplatform inline classes, now that inline classes have been deprecated?
    d
    b
    • 3
    • 6
  • m

    Mike Wolfson

    03/03/2022, 10:14 PM
    I have been trying to find the correct place to put my
    lint.xml
    file in my KMM project to allow me to suppress some of the main Lint errors (in particular the Graph generated classes are causing all sorts of issues for me). I see errors like this:
    /Users/MWolfson/.../shared/build/generated/sqldelight/code/AppDatabase/commonMain/com/company/eventable/cache/Event.kt:10:1: Lint error > [indent] Unexpected indentation (2) (should be 4)
    So I have created a
    lint.xml
    file with the following:
    <?xml version="1.0" encoding="UTF-8"?>
    <lint>
        <issue id="indent" severity="ignore"/>
    </lint>
    and I placed this in the following directory:
    /Users/MWolfson/.../shared/lint.xml
    BUT this doesn't have any effect?! What am I doing wrong? I have tried all sorts of permutations of values in the ignore file, and also tried to put that file in multiple different locations. Anyone that can help me with this Lint config challenge I would be eternally grateful. Also added this to my
    shared\build.gradle.kts:
    android{
    ...
    
    lint {
        quiet = false
        abortOnError = true
        lintConfig = file ("./lint.xml")
    }
    e
    • 2
    • 2
  • c

    Conrad Kramer

    03/04/2022, 6:59 AM
    I have a few simple C files that I would like to compile and use with cinterop, and I have a few questions 1. Is it possible to actually compile those C files as a part of my Gradle build? If so, what is the best way to go about it? 2. Assuming these C files compile to a static library and I include them in my Kotlin target, will they work on Android? Or do I need to write separate JNI bindings for Android, and then merge the interfaces into a cross-platform abstraction?
    j
    • 2
    • 24
  • s

    Sunny

    03/04/2022, 10:38 AM
    Hi, Working on formatting date in a project. For Android and IOS
    internal expect fun formatDate(value: Long, format: String): String
    is straight forward. For JavaScript in Kotlin/JS is there any equivalent for formatting the date.
    kotlin.js.Date
    has no formatting capabilities.
    kotlinx-datetime
    also seems to lack formatting capabilities. Am I missing something trivial?
    a
    m
    • 3
    • 4
  • g

    George

    03/04/2022, 11:23 AM
    Hi, folks. Im working on a kmm library. I i have a common main and some code in jvmMain targets. I want to produce also a ios/android variants based on common code. It is necessary to define the androidManifest.xml? I was wondering since i do not need currently extra code in my androidMain target if could omit it somehow. I can provide some snippets of my configs if it's needed.
    p
    r
    • 3
    • 12
  • h

    harry248

    03/04/2022, 12:04 PM
    Anyone got a Kotlin Multiplatform to work with Sonarqube?
    j
    • 2
    • 6
  • s

    Sunil Kumar

    03/04/2022, 4:36 PM
    Hi everyone, In Koltin multiplatform project, I have an object class in shared module in commonMain and i am trying to access and update some variables of that object class from native android and ios project, From android its working fine, but its showing this exception in ios project:
    Uncaught Kotlin exception: kotlin.native.concurrent.InvalidMutabilityException: mutation attempt of frozen com.buildingengines.sharedmoduletenant.core.service.KmmServiceLocator@1518f08
    How to solve this problem, cant we access and update shared module object class variables from swift ios? any workaround for this, Guys Please help. i am stuck with this. I need singleton class in shared module and then inject some native android and ios dependencies into that class on app startup.
    l
    • 2
    • 11
  • h

    humblehacker

    03/04/2022, 7:06 PM
    What is the best IDE to use for KMM? The FAQ suggests Android Studio, while also saying that one can use Intellij Ultimate with some limitations. Android Studio works for the most part, but there's no support for Swift. I typically do most of my iOS dev in AppCode, and I was happy to find a KMM plugin for AppCode. However, opening the project created in Android Studio in AppCode with the KMM plugin installed resulted in a number of issues, such as the project requiring conversion to a KMM project, facets that cannot be loaded, and a lot of red in the Kotlin syntax highlighting. I also tried creating the project in AppCode, but after restarting AppCode and reloading the project, I got the same facets cannot be loaded error ("unknown face type" kotlin-language and android). [edit: I updated AppCode while composing this, and just needed to reinstall the KMM related plugins]. Most of these are probably just growing pains for KMM, and I can open tickets for these things, but as someone just getting started with KMM, which IDE should I stick with for the least amount of difficulty?
    👍 1
    b
    e
    +3
    • 6
    • 10
  • s

    Sebastien Leclerc Lavallee

    03/05/2022, 5:31 AM
    Hello! I have an already present multiplatform project which I want to a ktor server module. I have a core multiplatform module like this:
    plugins {
      kotlin("multiplatform")
      kotlin("plugin.serialization")
    }
    
    version = "1.0.0"
    java.sourceCompatibility = JavaVersion.VERSION_1_8
    java.targetCompatibility = JavaVersion.VERSION_1_8
    
    kotlin {
      js(IR) {
        browser()
      }
    
      jvm()
    
      sourceSets {
        val commonMain by getting {
          dependencies {
            implementation(kotlin("stdlib-common"))
            implementation(Deps.kotlinxSerialization)
          }
        }
    
        val commonTest by getting {
          dependencies {
            api("org.jetbrains.kotlin:kotlin-test")
          }
        }
    
        val jvmMain by getting
        val jvmTest by getting
        val jsMain by getting
        val jsTest by getting
      }
    }
    And now I did add this new ktor module
    plugins {
      kotlin("jvm")
      kotlin("plugin.serialization")
      id("application")
    }
    version = "1.0.0"
    java.sourceCompatibility = JavaVersion.VERSION_1_8
    java.targetCompatibility = JavaVersion.VERSION_1_8
    
    dependencies {
      implementation(kotlin("stdlib"))
    
      implementation(project(":core"))
      implementation("io.ktor:ktor-server-core:1.6.1")
      implementation("io.ktor:ktor-server-netty:1.6.1")
      implementation("io.ktor:ktor-serialization:1.6.1")
      implementation("ch.qos.logback:logback-classic:1.2.6")
    }
    
    application {
      mainClass.set("ca.sebleclerc.api.ApplicationKt")
    }
    When I execute
    ./gradlew server:run
    I get this error:
    * What went wrong:
    Could not determine the dependencies of task ':server:run'.
    > Could not resolve all task dependencies for configuration ':server:runtimeClasspath'.
       > Could not resolve project :core.
         Required by:
             project :server
          > The consumer was configured to find a runtime of a library compatible with Java 8, packaged as a jar, preferably optimized for standard JVMs, and its dependencies declared externally, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm'. However we cannot choose between the following variants of project :core:
              - jvmRuntimeElements
              - ktlint
            All of them match the consumer attributes:
              - Variant 'jvmRuntimeElements' capability core:1.0.0 declares a runtime of a library, packaged as a jar, preferably optimized for standard JVMs, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm':
                  - Unmatched attributes:
                      - Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
                      - Doesn't say anything about its target Java version (required compatibility with Java 8)
    [... and so on]
    I understand it can’t match anything that is produced by my core module but I can’t find anything to make it work. I did tried a few things but nothing worked… Anybody have any clue? Hint? I am using Kotlin 1.6.20-M1 Thanks for the help 🙂
    s
    p
    • 3
    • 15
  • c

    cafonsomota

    03/05/2022, 5:35 PM
    hello all! I’ve been trying to understand this issue: • when trying to run the iOS app from Android Studio the simulator opens but the app doesn’t install if you go to run configurations there’s an error there saying “Error: Selected scheme “iosApp” does not support “iphonesimulator”“. while trying to debug this I’ve noticed that this happens due to cocoapods; I’ve tried the pod like
    SwiftLint
    and everything works, but if I use other ones like
    AlertToast
    or
    SDWebImageSwiftUI
    it doesn’t work. any ideia why? I’m able to run the app both from xcode and to install it in a real device
    m
    d
    • 3
    • 6
  • v

    Vivek Modi

    03/05/2022, 10:17 PM
    Hey guys, I am trying this kmm-basic-sample from the kotlin sample. I am trying to Add and configure Kotlin CocoaPods Gradle plugin from the offiical doc. I am trying to add this line
    kotlin("native.cocoapods") version "1.6.10"
    and I am getting-this weird issue. Can someone help on this
    org.gradle.internal.exceptions.LocationAwareException: Build file '/Users/vmodi/Downloads/kmm-basic-sample-master/shared/build.gradle.kts' line: 1
    e
    • 2
    • 5
  • c

    Conrad Kramer

    03/05/2022, 11:07 PM
    Is it possible to use expect and actual with a static function like
    SomeType.fromByteArray(data: ByteArray)
    ? Because I know you can’t expect companion objects
    :yes: 1
    b
    • 2
    • 2
  • e

    eygraber

    03/07/2022, 3:05 AM
    Will shared code in an expect class ever be supported? Or will I always need a concrete "shared" superclass?
    expect abstract class Foo {
      internal fun doAFoo() = println("Foo")
    }
    
    vs
    
    abstract class SharedFoo {
      internal fun doAFoo() = println("Foo")
    }
    
    expect abstract class Foo : SharedFoo()
    r
    • 2
    • 1
Powered by Linen
Title
e

eygraber

03/07/2022, 3:05 AM
Will shared code in an expect class ever be supported? Or will I always need a concrete "shared" superclass?
expect abstract class Foo {
  internal fun doAFoo() = println("Foo")
}

vs

abstract class SharedFoo {
  internal fun doAFoo() = println("Foo")
}

expect abstract class Foo : SharedFoo()
r

russhwolf

03/07/2022, 1:35 PM
https://youtrack.jetbrains.com/issue/KT-20427
View count: 7