Hi all! I'm having issues getting SwiftUI previews...
# room
b
Hi all! I'm having issues getting SwiftUI previews to work in Xcode since adding Room to my project. It's little diagnostic tool shows a bunch of missing (not found) sqlite3 symbols. Has anyone else had this problem?
I resolved this issue. In my shared module's build.gradle.kts, I had been specifying a static framework:
Copy code
listOf(
    iosX64(),
    iosArm64(),
    iosSimulatorArm64()
).forEach {
    it.binaries.framework {
        baseName = "MyAppKit"
        isStatic = true
    }
}
I had tried removing the static flag before, and adding a linker option for sqlite:
Copy code
it.binaries.framework {
        baseName = "MyAppKit"
        linkerOpts.add("-lsqlite3")
    }
But that also did not work. The working solution is to remove the static flag, and NOT set linker options:
Copy code
listOf(
    iosX64(),
    iosArm64(),
    iosSimulatorArm64()
).forEach {
    it.binaries.framework {
        baseName = "MyAppKit"
    }
}