brabo-hi
05/04/2022, 4:54 PMbrabo-hi
05/04/2022, 4:56 PMLinkDylibError: Failed to build ContentView.swift
Linking failed: linker command failed with exit code 1 (use -v to see invocation)
ld: warning: directory not found for option '-F/Applications/Xcode.app/Contents/SharedFrameworks-iphonesimulator'
Undefined symbols for architecture x86_64:
"_sqlite3_aggregate_context", referenced from:
_co_touchlab_sqliter_sqlite3_sqlite3_aggregate_context_wrapper139 in shared(result.o)
kpgalligan
05/04/2022, 8:05 PM3-38
. The error means you don’t have sqlite linked to the build. It looks like no version of iOS ships with 3.38 (https://github.com/yapstudios/YapDatabase/wiki/SQLite-version-(bundled-with-OS)). I haven’t tried different dialects myself, so not sure there’s anything to dig into there. You could build your own sqlite, but I don’t think you’d be getting that linker error if you did.kpgalligan
05/04/2022, 8:07 PMbrabo-hi
05/04/2022, 8:43 PMplugins{ id("app.cash.sqldelight") }
sqldelight {
database("AppDatabase") {
packageName = "com.example.db"
dialect = "app.cash.sqldelight:sqlite-3-18-dialect:$sqlDelightVersion"
}
}
kotlin {
sourceSets {
val commonMain by getting {
dependencies {
implementation("app.cash.sqldelight:runtime:$sqlDelightVersion")
implementation("app.cash.sqldelight:primitive-adapters:$sqlDelightVersion")
implementation("app.cash.sqldelight:coroutines-extensions:$sqlDelightVersion")
}
}
val androidMain by getting {
dependencies {
implementation("app.cash.sqldelight:android-driver:$sqlDelightVersion")
}
}
}
val iosMain by creating {
dependencies {
implementation("app.cash.sqldelight:native-driver:$sqlDelightVersion")
}
}
}
brabo-hi
05/04/2022, 8:44 PMkpgalligan
05/04/2022, 8:44 PMbrabo-hi
05/04/2022, 8:46 PMkpgalligan
05/04/2022, 8:47 PMkpgalligan
05/04/2022, 8:47 PM-lsqlite3
is the flagbrabo-hi
05/04/2022, 9:20 PMtargets.filterIsInstance<org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget>().forEach{
it.binaries.filterIsInstance<org.jetbrains.kotlin.gradle.plugin.mpp.Framework>()
.forEach { lib ->
lib.isStatic = false
lib.linkerOpts.add("-lsqlite3")
}
}