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

    Brandon Saunders

    11/07/2019, 7:45 PM
    hi everyone, small, what feels like a newbie question. I'm looking into using kotlin multiplatform to build some libraries for android/ios and javascript. I'm getting stuck on the gradle JS setup for our unit tests though. It seems most docs online use kotlin2js for doing things like installing mocha and populating nodemodules, but adding the kotlin2JS module with the multiplatform module returns the following error
    Cannot add extension with name 'kotlin', as there is an extension already registered with that name.
    This link, https://youtrack.jetbrains.com/issue/KT-32137?_ga=2.97965660.2132659469.1572979841-1716587075.1572304917, seems to suggest that support docs for multiplatform JS gradle is getting updated. Does anyone know if this is still accessible (I can't seem to connect to it via slack) or has an example gradle file that uses multiplatform to trigger a mocha run? Thank you!
    j
    • 2
    • 3
  • s

    Shan

    11/08/2019, 4:32 AM
    Anyone had any experience using Jitpack with a multiplatform library? Gradle is refusing to resolve my snapshots despite seemingly producing the correct artifacts and maven components.
    e
    k
    • 3
    • 15
  • s

    Sylvain Patenaude

    11/08/2019, 4:57 PM
    I turned on system diagnostics on my macOS-10.14 cloud agent and by looking at the generated build files, I noticed that the following outputs were identified as directories rather than files: - .../build/bin/ios/debugFramework/MySDK.framework (directory) - .../build/bin/ios/releaseFramework/MySDK.framework (directory) Any idea?
    k
    • 2
    • 3
  • d

    Dmitri Sh

    11/09/2019, 5:26 AM
    JB guys - I know this question was asked before (I know because I checked), but have to ask it again. When are we going to have KTOR iOS client Websockets library? Someone from JB said "ASAP" like six months ago. I know all is relative, but six months for ASAP is kind of... long 😥
    e
    • 2
    • 1
  • j

    Jérôme Gully

    11/09/2019, 11:48 AM
    Hi, is there a kotlin multiplatform gradle plugin reference somewhere ? like the ones for the android gradle plugin(http://google.github.io/android-gradle-dsl/current/). I searched but no result.
    r
    • 2
    • 1
  • a

    Andy Gibel

    11/09/2019, 7:48 PM
    Since top level functions are turned into static calls via Objective C headers - Is there a clean way to consolodate all my files under a singular "static class" instead of having names correlating to each of the files the functions are defined in?
    a
    • 2
    • 2
  • b

    basher

    11/10/2019, 8:42 PM
    We're interested to know if other teams used autodesk/Coroutineworker to help temporarily fill the Kotlin/Native multithreaded coroutines gap in their mpp projects. DM's open as well (if you want to be known privately and not listed in the readme). As MPP grows, there will likely be more opportunity to open source projects like this, which will eventually be deprecated with JB support/libraries https://twitter.com/benasher44/status/1193625968268591104?s=20
    ❤️ 1
    k
    m
    • 3
    • 4
  • n

    nrobi

    11/11/2019, 8:20 AM
    Anyone with some help, why I can’t reference my classes in my common module from my backend module?
    k
    • 2
    • 4
  • k

    Kurt Renzo Acosta

    11/11/2019, 9:56 AM
    Hi, guys! How do you declare flavors for Kotlin/Native? In Android I have two release types (Debug and Release) and two flavors (Dev and Production) so I have: - devDebug - devRelease - productionDebug - productionRelease I wanted to have these in iOS too but I can't seem to find any configuration so I only have Debug and Release for it. If I'm missing something, please do point me in the right direction. Many thanks!
    a
    a
    y
    • 4
    • 5
  • a

    Anastasia Finogenova

    11/11/2019, 10:45 PM
    Hey, is there a way to use K/N and Flutter together in my cross platform app at the moment?
    g
    k
    +5
    • 8
    • 52
  • n

    nrobi

    11/12/2019, 8:07 AM
    Hey, in my common I have three targets: iOS, android, jvm(for backend). For some reason I’m getting multiple errors, related to
    kotlin-stdlib
    , however in my
    commonMain
    sourceSet I’ve added the dependency. Anyone with some help?
    a
    k
    • 3
    • 10
  • s

    Sergio Casero

    11/12/2019, 6:58 PM
    Hello guys, I'm getting a strange behaviour when trying to catch error. The thing is, I have this function to handle errors with views:
    protected fun onRetry(error: Error, retry: () -> Unit): Unit =  view.showRetry(errorHandler.convert(error)) { retry() }
    Where
    view
    is an interface that
    activities
    or
    view controllers
    implement On android everything work as expected, the showRetry() function is called, but... on iOS, the app doesn't crash but
    showRetry()
    is not called The thing is that xCode detects the function, and I need to implement it as expected, but the function is never called
    s
    • 2
    • 4
  • m

    mbonnin

    11/13/2019, 6:13 PM
    Is there a MPP equivalent to
    ByteArrayOutputStream
    ? Something that: • I can write to • Grows automatically • I can get a
    ByteArray
    from once I'm done
    d
    o
    • 3
    • 6
  • b

    Brandon Saunders

    11/13/2019, 7:49 PM
    Hi multiplatform, I'm trying to get a multiplatform setup similar to a co-worker who is also working on the same codebase. we have a MP kotlin module that has been built, grabbed the iOS framework file and dropped that into a swift host project to consume it. I've booted up AppCode and dropped in the kotlin source to the host project and am attempting to set breakpoints. The project runs, the kotlin code is being executed, I can set breakpoints, but upon start the breakpoints show up as unable to be hit. Per my co-worker for him it just magically worked when the source files were dropped in. Is there something I'm missing to make the link between the framework file and the underlying source?
    k
    • 2
    • 6
  • d

    Dmitri Sh

    11/14/2019, 3:21 AM
    How do we represent Date in kotlinx serializable model in common code?
    s
    • 2
    • 3
  • n

    nrobi

    11/14/2019, 7:07 AM
    Is there a way to exclude a target from an
    expected
    class declaration? Or we should stick to modularizing more our common code?
    e
    • 2
    • 1
  • a

    akapanina

    11/14/2019, 11:54 AM
    Hi folks! We are working on new Kotlin website version - and there will be more info about Kotlin Multiplatform for new users. Right now we are looking for some github projects that we could show. Some examples are really well known - like DroidCon app by Touchlab, or SQLDelight library. I've also met many lovely pet projects (Galway Bus app is my personal favourite, probably because I'm a little bit obsessed with Ireland). But there is a huge chance we've missed something, and I would like to ask for your help to fix it 🙂 If you know some cool Kotlin MPP projects (as I mentioned above, hobby projects are also important) - please, share them in this thread. If you have Kotlin MPP in your production app, it's not published on github, but you would like to share its name and a little background - what feature was implemented with MPP - it also will be helpful. Our team would be extremely grateful to you.
    👍 27
    d
    b
    +11
    • 14
    • 14
  • s

    Sylvain Patenaude

    11/15/2019, 9:52 PM
    Slowly but surely. When I build on iOS with
    gradlew build iosTest
    , I get an error like this:
    Task 'iosTest' is ambiguous in root project 'MySDK'. Candidates are: 'iosTestBinaries', 'iosTestKlibrary', 'iosTestProcessResources'.
    The iOS part of my build.gradle looks like this: kotlin { iosX64("ios") { binaries { framework() } } sourceSets { commonMain { dependencies { implementation kotlin('stdlib-common') } } iosMain { } iosTest { } } }
    r
    • 2
    • 8
  • a

    Akhil Sunny

    11/16/2019, 2:14 AM
    Hi folks - I am a newbie to kotlin - trying to test kotlinjs output with mocha framework - tests are running , but the html report file generated is showing 0 tests(/build/classess/reports/tests/test/index.html). Can anyone pls help out here ? looking for a report in html/xml format. Thanks!!
    compileKotlin2Js {
        kotlinOptions {
            metaInfo = true
            outputFile = "${project.buildDir.path}/classes/main/${project.name}.js"
            sourceMap = true
            sourceMapEmbedSources = "always"
            moduleKind = 'umd'
        }
    }
    compileTestKotlin2Js { kotlinOptions.moduleKind = 'umd' }
    task populateNodeModules(type: Copy, dependsOn: compileTestKotlin2Js) {
        from compileKotlin2Js.destinationDir
        configurations.testCompile.each {
            from zipTree(it.absolutePath).matching { include '*.js' }
        }
        into "${buildDir}/node_modules"
    }
    node {
        download = true
    }
    task installMocha(type: NpmTask) {
        args = ['install', 'mocha']
    }
    task yarnInstall(type: YarnTask) {
        args = ['install']
    }
    task runMocha(type: NodeTask, dependsOn: [compileTestKotlin2Js, populateNodeModules,yarnInstall, installMocha]) {
        script = file('node_modules/mocha/bin/mocha')
        args = [compileTestKotlin2Js.outputFile]
    }
    task runTest {
        dependsOn runMocha
    }
    test.dependsOn runTest
    i
    • 2
    • 1
  • a

    altavir

    11/16/2019, 2:29 PM
    Does anybody know if current MPP plugin works with JUnit5? I tried it, but did not manage it to work.
    s
    r
    • 3
    • 8
  • d

    darkmoon_uk

    11/17/2019, 3:33 AM
    Returned to working on iOS/MP after some time away and found the situation with AppCode/Xcode/MPP compatibility has become complicated. What version of each are people using successfully at the moment?
    ➕ 1
    a
    • 2
    • 5
  • b

    bod

    11/17/2019, 4:55 PM
    Hello, World! I'm trying to use an extension fun from Swift and it looks like it's exported as a method that takes the receiver as its first argument (so, not usable as an extension in Swift). Is that normal / a known limitation, or am I doing something wrong? (note: it's an extension on an Interface, if that changes anything)
    b
    • 2
    • 5
  • m

    matej

    11/18/2019, 1:44 PM
    I've been thinking, one of the big advantages of Kotlin over traditional multiplatform frameworks, like Xamarin, React Native etc., seems to be that it isn't a big idea solution that wants you to marry it, "till death do us part" style. In theory, you could find out that KMP is not for your team, or your project, and relatively painlessly move to a classical native mobile approach, or even something completely different - which is not at all the case for those other frameworks. So, please correct me if I'm wrong, but on iOS, you just have the framework that gets generated, and you could keep that but ditch the KMP toolchain entirely, and piecewise replace what's in the framework, or leave it as it is and use it as a library for as long as it works. But what about Android, is there a similar route that can be taken, or, if you want to use what's in the common code, do you have to drag KMP along with you forever?
    s
    k
    +3
    • 6
    • 20
  • k

    Kris Wong

    11/18/2019, 3:54 PM
    it seems like there is no string formatting functionality in stdlib-common. has anyone found that?
    s
    b
    • 3
    • 5
  • k

    Kurt Renzo Acosta

    11/19/2019, 12:56 AM
    Does anyone know if there's a compiled list of the updates for MPP on 1.3.60?
    • 1
    • 1
  • t

    thana

    11/19/2019, 9:08 AM
    is there any current documentation about how to set up an mpp nowadays? https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html seems to be pretty putdated
    m
    t
    +3
    • 6
    • 29
  • k

    Kurt Renzo Acosta

    11/20/2019, 8:36 AM
    Anyone having issues with cocoapods? The generated doesn't seem to generate the framework for my native module. It runs a
    generateDummyFramework
    and generates this
    dummy.h
    //! Project version number for dummy.
    FOUNDATION_EXPORT double dummyVersionNumber;
    
    //! Project version string for dummy.
    FOUNDATION_EXPORT const unsigned char dummyVersionString[];
    d
    n
    m
    • 4
    • 4
  • m

    mzgreen

    11/20/2019, 10:05 AM
    After updating to 1.3.60 my project stopped downloading dependencies for
    ios
    and
    macos
    targets.
    a
    d
    +2
    • 5
    • 10
  • s

    steenooo

    11/20/2019, 12:08 PM
    is it possible to have multiple multiplatform uhm... implementations that all target the same jvm version? But differ in implementation (fx for reusing code between plugins for different apps)
    k
    • 2
    • 3
  • c

    Cristián Arenas

    11/20/2019, 12:57 PM
    Hello everybody! I'm new here. How can I generate a
    .framework
    that works in both an iOS device and the simulator? Right now I'm changing 2 lines in my
    build.gradle
    every time I want to switch between targeting iosX64 (simulator) and iosArm64 (actual device).
    v
    a
    +3
    • 6
    • 13
Powered by Linen
Title
c

Cristián Arenas

11/20/2019, 12:57 PM
Hello everybody! I'm new here. How can I generate a
.framework
that works in both an iOS device and the simulator? Right now I'm changing 2 lines in my
build.gradle
every time I want to switch between targeting iosX64 (simulator) and iosArm64 (actual device).
These are the 2 lines I change, just in case it's relevant:
-    iosX64("ios") {
+    iosArm64("ios") {
-                implementation "io.ktor:ktor-client-serialization-iosx64:${versions.ktor}"
+                implementation "io.ktor:ktor-client-serialization-iosarm64:${versions.ktor}"
v

vanniktech

11/20/2019, 1:10 PM
//select iOS target platform depending on the Xcode environment variables
  val iOSTarget: (String, KotlinNativeTarget.() -> Unit) -> KotlinNativeTarget = if (System.getenv("SDK_NAME")?.startsWith("iphoneos") == true) ::iosArm64 else ::iosX64

  iOSTarget("ios") {

  }
c

Cristián Arenas

11/20/2019, 1:15 PM
OK, if I understand that correctly, that’ll help me automate this change, to generate the correct framework. But that does not generate a
.framework
that works on both platforms, I need to distribute the framework so it should include appropriate binaries for both architectures. Do you know how to achieve this?
v

vanniktech

11/20/2019, 1:16 PM
Nope. Just started with multiplatform this Sunday
c

Cristián Arenas

11/20/2019, 1:17 PM
Oh OK, don’t worry then 🙂
I may end up using that if I can’t figure it out 😅 It’s better than doing it manually
a

Artyom Degtyarev [JB]

11/20/2019, 1:34 PM
Are you talking about something like described here(https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#building-final-native-binaries) in the Building universal frameworks section*?*
c

Cristián Arenas

11/20/2019, 1:35 PM
Oh, I think that’s exactly what I want! I didn’t know they were called “universal frameworks”. Thanks! ❤️
t

tylerwilson

11/20/2019, 2:15 PM
If you are already using Cocoapods in your project, I would suggest going that route: use the cocoapods plugin that generates a podspec which you link to from your Xcode project. Then when you build your project, it will rebuild the framework (if needed) using the correct current architecture. (https://kotlinlang.org/docs/reference/native/cocoapods.html)
k

Konstantin Petrukhnov

11/21/2019, 4:27 AM
@Cristián Arenas One way to build universal framework: https://github.com/Ekahau/khtf-iosapp-fw/ You may also need to have bitcode enabled and making your framework dynamic.
m

mkojadinovic

11/22/2019, 8:31 AM
I do something like this:
iosArm64 {
        binaries {
            framework('Logger')
        }
    }

    iosX64 {
        binaries {
            framework('Logger')
        }
    }
// Create a task building a fat framework.
    task fatFramework(type: FatFrameworkTask) {
        def buildType = project.findProperty('kotlin.build.type') ?: 'DEBUG'
        baseName = "Logger"

        final File frameworkDir = new File(buildDir, "xcode-frameworks")
        destinationDir = frameworkDir

        from(
                targets.iosArm64.binaries.getFramework('Logger', buildType),
                targets.iosX64.binaries.getFramework('Logger', buildType)
        )
    }
Also, you have to add next:
iosMain {
            dependencies {
                implementation deps.coroutineNative
                implementation deps.kotlinxSerRuntimeNative

                implementation deps.ktoriOS
                implementation deps.ktorSerializationNative

                // SQL Delight
                implementation deps.sqlDelightiOS
            }
        }
        iosX64Main {
            dependsOn iosMain
            kotlin.srcDirs += project.file("src/iosMain/kotlin")
        }

        iosArm64Main {
            dependsOn iosMain
            kotlin.srcDirs += project.file("src/iosMain/kotlin")
        }
k

Konstantin Petrukhnov

11/25/2019, 6:06 AM
@mkojadinovic could you please share full example of build.gradle?
m

mkojadinovic

11/25/2019, 7:21 AM
import org.jetbrains.kotlin.gradle.tasks.FatFrameworkTask

apply plugin: "kotlin-multiplatform"
apply plugin: 'com.android.library'
apply plugin: 'kotlinx-serialization'
apply plugin: "com.squareup.sqldelight"
apply plugin: 'kotlin-kapt'

android {
    defaultConfig {
        minSdkVersion minSdk
        compileSdkVersion compileSdk
    }
    packagingOptions {
        exclude "META-INF/*"
    }

    testOptions {
        unitTests.returnDefaultValues = true
    }
}

kotlin {
    iosArm64 {
        binaries {
            framework('Logger')
        }
    }

    iosX64 {
        binaries {
            framework('Logger')
        }
    }


    // Create a task building a fat framework.
    task fatFramework(type: FatFrameworkTask) {
        def buildType = project.findProperty('kotlin.build.type') ?: 'DEBUG'
        baseName = "Logger"

        final File frameworkDir = new File(buildDir, "xcode-frameworks")
        destinationDir = frameworkDir

        from(
                targets.iosArm64.binaries.getFramework('Logger', buildType),
                targets.iosX64.binaries.getFramework('Logger', buildType)
        )
    }

    android()

    sourceSets {
        all {
            languageSettings {
                useExperimentalAnnotation('kotlin.Experimental')
            }
        }
        commonMain {
            dependencies {
                implementation deps.kotlinCommon
                implementation deps.coroutineCommon
                implementation deps.kotlinxSerRuntimeCommon

                implementation deps.ktorCore
                implementation deps.ktorSerialization

                // SQL Delight
                implementation deps.sqlDelightJVM

                implementation deps.kodeinErased
            }
        }
        commonTest {
            dependencies {
                implementation deps.kotlinReflect
                implementation deps.test.mockkCommon

                implementation deps.test.kotlinTestCommon
                implementation deps.test.kotlinAnnotCommon

                api deps.sqlDelightJVM
                api deps.test.ktorMock
            }
        }
        androidMain {
            dependencies {
                implementation deps.kotlin
                implementation deps.coroutineAndroid
                implementation deps.kotlinxSerRuntime

                implementation deps.ktorAndroid
                implementation deps.ktorSerializationJvm

                //Crashlytics
                implementation deps.crashlytics

                implementation deps.network.gson
                implementation deps.network.retrofit
                implementation deps.network.okhttp

                // SQL Delight
                implementation deps.sqlDelightAndroid

                implementation deps.kodeinErased
            }
        }
        androidTest {
            dependencies {
                implementation deps.test.kotlinTest
                implementation deps.test.kotlinTestJunit

                api deps.sqlDelightJVM

                implementation deps.test.ktorMockJvm
                implementation deps.test.kotlinTestJunit
                implementation deps.test.kotlinTest
                implementation deps.test.mockk
            }
        }
        iosMain {
            dependencies {
                implementation deps.coroutineNative
                implementation deps.kotlinxSerRuntimeNative

                implementation deps.ktoriOS
                implementation deps.ktorSerializationNative

                // SQL Delight
                implementation deps.sqlDelightiOS
            }
        }
        iosTest {
            dependencies {
                api deps.sqlDelightiOS

                api deps.test.ktorMockNative
            }
        }
        iosX64Main {
            dependsOn iosMain
            kotlin.srcDirs += project.file("src/iosMain/kotlin")
        }

        iosArm64Main {
            dependsOn iosMain
            kotlin.srcDirs += project.file("src/iosMain/kotlin")
        }
    }
}

sqldelight {
    LoggerDatabase {
        packageName = "com.example.logger"
    }
}

configurations {
    compileClasspath
}

tasks.build.dependsOn fatFramework


kapt {
    correctErrorTypes = true
    mapDiagnosticLocations = true
}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
    sourceCompatibility = JavaVersion.VERSION_1_8
    targetCompatibility = JavaVersion.VERSION_1_8

    kotlinOptions {
        jvmTarget = '1.8'
    }
}
View count: 2