https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
j

John O'Reilly

03/28/2021, 10:40 AM
I've been primarily using CocoaPods plugin for KMP projects here but was helping someone with issue they were seeing resolving SQLDelight dependency in Android Studio in iOS source set when using "packForXCode" approach (that you get by default when using KMM plugin for example). In such a project you get following by default
Copy code
ios {
        binaries {
            framework {
                baseName = "shared"
            }
        }
    }
If you then add following to
iosMain
dependencies (along with
commonMain
one)
Copy code
implementation("com.squareup.sqldelight:native-driver:$sqldelight")
and try then for example to create instance of
NativeSqliteDriver
in iosMain source, Android Studio doesn't show option to import and also shows error if you manually add import. If however we add
iosX64("ios")
for example then we don't see this issue. Anyone else come across this?
z

zalewski.se

03/28/2021, 10:51 AM
j

John O'Reilly

03/28/2021, 11:01 AM
interesting, thanks....I've historically typically been doing likes of following which I guess doesn't run in to this issue
Copy code
val isiOSDevice = sdkName.orEmpty().startsWith("iphoneos")
    if (isiOSDevice) {
        iosArm64("iOS")
    } else {
        iosX64("iOS")
    }
s

Shabinder Singh

04/23/2021, 11:07 PM
just spent 1 hour on this and encountered your post while desperately searching for solution🙃