Simonas Brazauskas
07/09/2021, 9:16 AM.dSYM
for static frameworks? I am asking because when ios app crashes with kotlin native library, stack trace does not have anything useful. I have this from the symbolication documentation, but this only works with dynamic frameworks
targets.withType<org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget> {
binaries.all {
freeCompilerArgs += "-Xadd-light-debug=enable"
}
}
I am using sqldelight library with sqlcipher, and if library is static i do not need to link lsqlcipher
manually, otherwise if library is dynamic i need to link with either lsqlite3
or lsqlcipher
, but somehow it does not work and compiler complains that it cannot find lsqlcipher
. I have added sqlcipher as cocoapod
cocoapods {
this.ios.deploymentTarget = "13.0"
// Configure fields required by CocoaPods.
summary = "Secoris core"
homepage = "<https://github.com/JetBrains/kotlin>"
// You can change the name of the produced framework.
// By default, it is the name of the Gradle project.
frameworkName = binaryBaseName
pod("SQLCipher", "~> 4.4")
}
linking is done like this
targets
.flatMap { it.compilations }
.filterIsInstance<org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeCompilation>()
.forEach { compilationUnit ->
compilationUnit.kotlinOptions.freeCompilerArgs += arrayOf("-linker-options", "-lsqlcipher")
}
but this gives following error ld: library not found for -lsqlcipher
. So in conclusion i am able to have encrypted database with sqlcipher if i use static library, with no linking needed, but then there is no .dSYM
for crash stack traces, or i can have .dSYM
with dynamic framework, but then sqldelight links to lsqlite3
and there is no encryption.matej
07/12/2021, 5:57 AMmatej
07/13/2021, 8:00 AMSimonas Brazauskas
07/13/2021, 9:52 AMtargets.withType<org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget> {
binaries.withType<org.jetbrains.kotlin.gradle.plugin.mpp.Framework> {
isStatic = true
}
}
@matejmatej
07/14/2021, 11:13 AMsyntax error in "PRAGMA key = ?;"
. Did you encounter anything like this?Simonas Brazauskas
07/14/2021, 1:42 PMimplementation("co.touchlab:sqliter-driver:1.0.3") {
version {
strictly("1.0.3")
}
}
Simonas Brazauskas
07/14/2021, 1:43 PMcom.squareup.sqldelight:native-driver:1.5.0
depends on sqliter which has a bugmatej
07/14/2021, 5:59 PMmatej
07/14/2021, 7:50 PMco.touchlab:sqliter-driver:1.0.3
was the missing piece!matej
07/14/2021, 7:50 PMmatej
07/14/2021, 7:55 PMmatej
07/14/2021, 8:00 PM-framework "SQLCipher"
to the project level linker flags, then for my main target's linker flags, I added $(inherited)
and removed -framework "SQLCipher"
, because the inheritance will already add it in first place.matej
07/14/2021, 8:03 PMmatej
07/14/2021, 8:14 PM-framework "SQLCipher"
should be added as two separate lines, -framework
and then "SQLCipher"
Simonas Brazauskas
07/20/2021, 5:53 PM