Hi there, I am trying to use apollo and its cachin...
# apollo-kotlin
d
Hi there, I am trying to use apollo and its caching but I got this error on the iOS project. Could anyone help me? Thank a lot.
Module "com.apollographql.apollo3:apollo-normalized-cache-sqlite (com.apollographql.apollo3:apollo-normalized-cache-sqlite-iossimulatorarm64)" has a reference to symbol co.touchlab.sqliter/DatabaseConfiguration.Extended.<init>|671405973411897455[0]. Neither the module itself nor its dependencies contain such declaration.
b
This doesn’t ring a bell - but I haven’t tried to setup a project with an iOS target for a while 😅. Maybe you can have a look at Confetti, and see if there are differences with your project's setup?
d
If I comment this two lines then it’s working @bod. any clue for that? Note that. On my shared module also has
apollo-kotlin
and
sqldelight
libraries iOS Swift project has
apollo
and
apollo/sqlite
libraries as well. The error occurs when compile the iOS project, not runtime.
b
The problem seems related to sqliter, which is a dependency of
apollo-normalized-cache-sqlite
(so it makes sense that commenting these lines will remove the issue). Maybe there's a discrepancy in the version that's used? Could you share what you get from
./gradlew :yourmodule:dependencies
?
d
dependencies.txt
It’s very long 😄
b
if I interpret that correctly, you are explicitly depending on sqldelight 2.0.0?
d
yes, I am using sqldelight as well in my project.
Copy code
id("app.cash.sqldelight") version "2.0.0-rc02"
b
that depends on a more recent version of sqliter - not sure if your issue is due to that, but it may be worth trying to simplify your project a bit first (if possible), remove some dependencies, and see if you still have the issue
actually, you could also try to use the latest alpha of Apollo Kotlin v4 (
4.0.0-alpha.2
), since it also depends on sqldelight 2!
d
Thanks @bod. Upgraded to 4.0.0 but looks like it is still depending on sqldelight 1.5.5 . am I correct?
b
woops! Sorry, you're right, this hasn't been released yet. You can try to use the latest snapshot (
4.0.0-alpha.3-SNAPSHOT
) then - instructions are here.
d
I have just tried to setup with 4.0.0-apha.3-snapshot but I got another error
Could not find "/Users/duckie2910/.gradle/caches/modules-2/files-2.1/com.apollographql.apollo3/apollo-normalized-cache-sqlite-iossimulatorarm64/4.0.0-alpha.3-SNAPSHOT/5549f76a41871da4271a3e7405a93cc41639e104/apollo-normalized-cache-sqlite-iossimulatorarm64-4.0.0-alpha.3-SNAPSHOT.klib
b
When does this happen?
d
When trying to compile the iOS project.
b
so inside of XCode, right?
d
yes.
b
and does this file exist?
d
it does .
here is the full log error
Could not find "/Users/duckie2910/.gradle/caches/modules-2/files-2.1/com.apollographql.apollo3/apollo-normalized-cache-sqlite-iossimulatorarm64/4.0.0-alpha.3-SNAPSHOT/5549f76a41871da4271a3e7405a93cc41639e104/apollo-normalized-cache-sqlite-iossimulatorarm64-4.0.0-alpha.3-SNAPSHOT.klib" in [/Users/duckie2910/Documents/upscale/goupscale-kmm-modules/iOSApp-Example/Pods, /Users/duckie2910/.konan/klib, /Users/duckie2910/.konan/kotlin-native-prebuilt-macos-aarch64-1.8.21/klib/common, /Users/duckie2910/.konan/kotlin-native-prebuilt-macos-aarch64-1.8.21/klib/platform/ios_simulator_arm64]
b
Hmmm I must admit I don't have a clue 🤔. I guess I would try to simplify the library, and try to start with a simple version that works in Xcode/iOS. Then add things progressively until it breaks, so you can know which part is the culprit.
d
how about the warning. it said that skipping.
b
ah this is a good hint. What version of Kotlin do you use in your project? Could you try with 1.9?
d
Thank you so much. everything is working now 💯
b
ahhh that is great news!