siraf
03/20/2025, 4:25 PMkotlin {
cocoapods {
summary = "My Library"
homepage = "github_path_to_the_library"
ios.deploymentTarget = "14.0"
tasks.withType(org.jetbrains.kotlin.gradle.tasks.CInteropProcess::class.java) {
settings.compilerOpts("-DNS_FORMAT_ARGUMENT(A)=")
}
framework {
baseName = "MyLibrary"
}
pod(name = "SQLCipher", version = "4.5.7") // <- HERE
…
}
}
kpgalligan
03/20/2025, 4:33 PMpod(name = "SQLCipher", version = "4.5.7")
does is run cinterop on SQLCipher, then include the native dependency in builds and tests. Producing a version of that for SPM would be a huge effort. It is something I think JetBrains should have done years ago, and is a major issue across many KMP libraries that need native libraries included.kpgalligan
03/20/2025, 4:34 PMIn order to install the Sentry Kotlin Multiplatform SDK, you need to use Cocoapods and Swift Package Manager simultaneously, which might seem unconventional at first, especially if you're accustomed to using SPM for all your dependencies
kpgalligan
03/20/2025, 4:35 PMkpgalligan
03/20/2025, 4:36 PMsiraf
03/20/2025, 4:39 PMkpgalligan
03/20/2025, 4:39 PMsiraf
03/20/2025, 4:40 PMkpgalligan
03/20/2025, 4:42 PMkpgalligan
03/20/2025, 4:45 PMpod
block is only there to run cinterop. It's hard to explain. KMP's real learning curve is linking.siraf
03/20/2025, 4:53 PMSQLITE_NOTADB
crash when updating the app(on fresh install after deleting app it worked fine). Also I could not move the SQLCipher from KMM to iOS directly since all the stuff is handled in KMM.
However, if I understood you correctly, with the current implementation I pasted in the question, I can still follow KMMBridge SPM Quick Start and keep SQLCipher like it is, adding dependency to the podspec and KMM will still be available to handle it, without me having a podfile and stuff on the iOS side?kpgalligan
03/20/2025, 4:58 PMAlso I could not move the SQLCipher from KMM to iOS directly since all the stuff is handled in KMM.Not sure what you mean by this. SQLCipher on ios builds the same references as sqlite. The "extra" stuff it does is internal and/or in sql statements. It's been a while, though. It's maybe adding some C calls on top, but IIRC, the calls necessary to encrypt the DB are available to stock sqlite. You just won't get encryption. CocoaPods is just adding the SQLCipher dependency, which CocoaPods in Xcode is using to add SQLCiper. For SPM, you'd need to add that manually to your Xcode build.
kpgalligan
03/20/2025, 4:58 PMSQLITE_NOTADB
siraf
03/20/2025, 5:00 PMFor SPM, you’d need to add that manually to your Xcode build.you mean for installing SQLCipher using SPM or KMMBridge with SPM? I am asking because SQLCipher is not available for SPM yet.
kpgalligan
03/20/2025, 5:01 PMSQLCipher is not available for SPM yet.Oh, weird. I did not know that. The client project we did last year was using CocoaPods (which is rare these days)
kpgalligan
03/20/2025, 5:01 PMsiraf
03/20/2025, 5:04 PMkpgalligan
03/20/2025, 5:16 PMkpgalligan
03/20/2025, 5:18 PMsiraf
04/08/2025, 1:55 PMkpgalligan
04/08/2025, 2:08 PMsiraf
04/08/2025, 2:10 PMkpgalligan
04/08/2025, 2:30 PMLIBRARY_VERSION=0.1
In the GitHub Actions workflow, read the value:
- uses: touchlab/read-property@0.1
id: versionBasePropertyValue
with:
file: ./gradle.properties
property: ${{ inputs.versionBaseProperty }}
Then pass that to autoversion:
- uses: touchlab/autoversion-nextversion@main
id: autoversion
with:
versionBase: ${{ steps.versionBasePropertyValue.outputs.propVal }}
Then that gets passed into the Gradle build task:
-PAUTO_VERSION=${{ steps.autoversion.outputs.nextVersion }}
You can get a sense for how it works from this: https://github.com/touchlab/KMMBridgeSKIETemplate. That's an old template, though, which had an overly CI setup. You should just need to add the stuff mentioned above, then in the Gradle build script, test if AUTO_VERSION was passed in, and if so, use that.
val autoVersion = project.property(
if (project.hasProperty("AUTO_VERSION")) {
"AUTO_VERSION"
} else {
"LIBRARY_VERSION"
}
) as String
subprojects {
val GROUP: String by project
group = GROUP
version = autoVersion
}
You can see it in https://github.com/touchlab/KMMBridgeSKIETemplate/blob/main/build.gradle.kts#L13