Yassine Abou
06/06/2025, 4:52 AMCould not create instance of:
This seems tied to SQLDelight worker configuration
single {
val driver = JdbcSqliteDriver(JdbcSqliteDriver.IN_MEMORY)
.also { LlmsDatabase.Schema.create(it) }
.apply { enableForeignKeys() }
LlmsDatabaseWrapper(driver, LlmsDatabase(driver))
}
This worked fine in debug builds but failed in release.
What I Tried
Following guidance from this Koin issue , I modified the code to use a persistent database with a cache directory:
val appCacheDirectory = appCacheDirectory(appId = "org.yassineabou.llms", createDir = true)
val driver = JdbcSqliteDriver(url = "jdbc:sqlite:$appCacheDirectory/LlmsDatabase.db", schema = LlmsDatabase.Schema).apply {
enableForeignKeys()
}
LlmsDatabaseWrapper(driver, LlmsDatabase(driver))
However, the error persists in release builds. For more information check out my repository: https://github.com/yassineAbou/LLMSAlexander Maryanovsky
06/06/2025, 7:39 AMmodules(javax.sql)
to nativeDistrubutionYassine Abou
06/06/2025, 7:44 AMAlexander Maryanovsky
06/06/2025, 7:59 AMJacob Ras
06/06/2025, 10:32 AMYassine Abou
06/07/2025, 1:02 AMjava.sql.SQLException
– No driver matches the JDBC URL jdbc:sqlite
How can I resolve this issue?Alexander Maryanovsky
06/07/2025, 5:51 AMYassine Abou
06/08/2025, 11:01 PM-keep class org.sqlite.** { *; }