https://kotlinlang.org logo
#amper
Title
# amper
s

salomonbrys

03/15/2024, 9:25 AM
If I'm using sqlite, how can I add the sqlite dependency to the generated ios app ?
a

andrey.dernov

03/15/2024, 12:01 PM
Could you, please, elaborate a bit on your project? Do you use SQLDelight in your project? Do use shared common code for abstracting the persistence layer? Thanks.
s

salomonbrys

03/15/2024, 12:10 PM
Yes and yes. I have a common module with SQLDelight. When I compile the iOS app, the SQLite symbols are missing.
a

andrey.dernov

03/15/2024, 2:17 PM
To include SQLDelight dependency, please use Gradle via the Gradle interop.
s

salomonbrys

03/15/2024, 10:23 PM
@andrey.dernov I included Sqldelight with gradle interop without issue (and it works no problem on the Android app). The problem comes when running the
buildIosAppMain
task. The app needs to be linked with the sqlite3 dynamic lib provided with XCode. Basically, how do you do this using Amper ?
a

andrey.dernov

03/16/2024, 9:54 AM
It looks like the native
sqlite3
library needs to be installed in the system separately.
s

salomonbrys

03/16/2024, 10:03 AM
In which system ? This lib is provided with XCode. It does not need to be installed, it needs to be linked with the produced app when building it with
buildIosAppMain
a

andrey.dernov

03/18/2024, 11:11 AM
At the moment Amper does not have this functionality. Please use Gradle to link native libraries for the build
s

salomonbrys

03/18/2024, 11:12 AM
How ? What is the Gradle API ? What's the syntax ?
a

andrey.dernov

03/18/2024, 11:50 AM
I have a common module with SQLDelight.
Do you use SQLDelight Gradle plugin? sqldelight links system sqlite automatically when sqldelight gradle plugin is applied.
s

salomonbrys

03/18/2024, 11:51 AM
Yes, I use the SQLite Gradle plugin.
The framework compiles fine. Its the app that does not compile.
a

andrey.dernov

03/18/2024, 11:52 AM
What is the error?
s

salomonbrys

03/18/2024, 12:00 PM
message has been deleted
Maybe I need to add the sqldelight plugin to the
ios-app
module. (I only use it in the
shared
module).
Yep, that seems to do the trick. The Sqldelight plugin needs to be applied on the
ios-app
as well.
a

andrey.dernov

03/18/2024, 12:03 PM
Great, glad to hear it works now!
👍 1
s

salomonbrys

03/18/2024, 12:03 PM
Thanks for your help 🙂
🙌 1
3 Views