https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
k

khiari youssef

12/04/2023, 10:41 AM
Hello guys, i’m working on a compose multiplatform app and i’ve encoutered this seemingly common issue https://github.com/JetBrains/compose-multiplatform/issues/3437 , this only happens when adding the sqldelight plugin to a compose multiplatform project. (kotlin 1.9.21) and there seems to be no solution yet ! i need this fixed asap or any suggestions for an alternative local database multiplatform library ? thanks
p

Pablichjenkov

12/04/2023, 10:51 AM
If you are not covering js target you could try realmdb or couchbase. This is a couchbase KMP wrapper: https://github.com/jeffdgr8/kotbase
1
k

khiari youssef

12/04/2023, 10:57 AM
Thanks ! going for couchbase as temporary solution !
👍 1
p

Pablichjenkov

12/04/2023, 11:08 AM
The main maintainer Jeff is very active in this workspace.
❤️ 1
e

Enol Simón

12/04/2023, 2:01 PM
It;s very strange, I am using SQLdelight for both iOS and Android without a problem. And I can not see big difference with your configuration
k

khiari youssef

12/04/2023, 2:40 PM
This happens particularly in compose multiplatform projects, i also have sqldelight in other kmp projects without shared UI and no issues found with that.
e

Enol Simón

12/04/2023, 2:43 PM
But I am sharing UI too
k

khiari youssef

12/04/2023, 2:47 PM
strange 😞 and the solution to the issue doesn’t look obvious ! i don’t have time to search further ! i have deadlines
😔 1
e

Enol Simón

12/04/2023, 2:48 PM
Are you using dependency injection?
p

Pablichjenkov

12/04/2023, 3:02 PM
I believe there was an issue when mixing SQLDelight in the same shared module. If you use a separate module works fine. Also the SQLDelight plugin needs to be applied to the root gradle project and specify the version there. You can keep digging into it, I have a couple of projects using SQLDelight and they work fine. However, if you are limited in time, realmdb or couchbase will be faster imo, due to the nature of SQL vs nosql
k

khiari youssef

12/04/2023, 3:13 PM
@Enol Simón i’m still configuring the project and yes i’m using Koin but it is not related to the issue since it appeared before integrating koin, @Pablichjenkov i think i should try adding it in the root project instead and see what happens !
👍 1
p

Pablichjenkov

12/04/2023, 4:03 PM
Yes, specify the version either there or in settings.gradle if you are adding the plugins using settings.gradle.
3 Views