If I'm using sqlite, how can I add the sqlite depe...
# amper
s
If I'm using sqlite, how can I add the sqlite dependency to the generated ios app ?
a
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
Yes and yes. I have a common module with SQLDelight. When I compile the iOS app, the SQLite symbols are missing.
a
To include SQLDelight dependency, please use Gradle via the Gradle interop.
s
@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
It looks like the native
sqlite3
library needs to be installed in the system separately.
s
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
At the moment Amper does not have this functionality. Please use Gradle to link native libraries for the build
s
How ? What is the Gradle API ? What's the syntax ?
a
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
Yes, I use the SQLite Gradle plugin.
The framework compiles fine. Its the app that does not compile.
a
What is the error?
s
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
Great, glad to hear it works now!
👍 1
s
Thanks for your help 🙂
🙌 1