Hi there. :wave: We are using apollo multiplatfor...
# apollo-kotlin
a
Hi there. 👋 We are using apollo multiplatform library in our internal library and decided to publish it to our internal repository. But by some reason we got an exception that apollo is not found during compiling metadata for publishing. When I’m bulding android or ios locally with this multiplatform module - everything works fine. Failed task is “compileIosMainKotlinMetadata”.
Copy code
> Task :drivers-app-api:compileIosMainKotlinMetadata FAILED
e: /Users/alexander.ivanov/Development/pmob-sdrv-graphql-api-tool/sources/drivers-app-api/src/iosMain/kotlin/com/arrival/adp/drivers/app/api/DictionariesApi.kt: (3, 12): Unresolved reference: apollographql
e: /Users/alexander.ivanov/Development/pmob-sdrv-graphql-api-tool/sources/drivers-app-api/src/iosMain/kotlin/com/arrival/adp/drivers/app/api/DictionariesApi.kt: (10, 2): Unresolved reference: ApolloExperimental
e: /Users/alexander.ivanov/Development/pmob-sdrv-graphql-api-tool/sources/drivers-app-api/src/iosMain/kotlin/com/arrival/adp/drivers/app/api/DriverScheduleApi.kt: (3, 12): Unresolved reference: apollographql
e: /Users/alexander.ivanov/Development/pmob-sdrv-graphql-api-tool/sources/drivers-app-api/src/iosMain/kotlin/com/arrival/adp/drivers/app/api/DriverScheduleApi.kt: (11, 2): Unresolved reference: ApolloExperimental
e: /Users/alexander.ivanov/Development/pmob-sdrv-graphql-api-tool/sources/drivers-app-api/src/iosMain/kotlin/com/arrival/adp/drivers/app/api/DriversApi.kt: (3, 12):
Any ideas of a reason for that behavior?
m
That unusual.... Does JVM compile fine?
Maybe the
api
,
implementation
thing but that doesn't sound too likely
You can check your published
.module
files to check what's included there.
a
Yes, it happens only when I’m trying to publish library to our private repository. JVM part compiles fine and even deployed to repo.
m
Ah so that's when publishing the lib, not when using it?
a
yes, it is during publishing process.
m
Yes, sorry I misread
Let me see if I can reproduce quickly
a
Thank you 🙏
m
No luck reproducing the issue 😞
If you can change this to make it fail I can look into it: https://github.com/martinbonnin/reproducer-mpp-publication/tree/main
a
I will try to create some demo project.
m
Yep, a reproducer would be great 👍
a
Thanks, also will try yours
👍 1
@mbonnin Hi, I was able to reproduce an issue with following configuration: https://github.com/alexander-ivanoff/kmm-apollo-reproducer
m
Oooooo nice, will look into it!
a
🙏
m
Copy code
kotlin.mpp.enableGranularSourceSetsMetadata=true
kotlin.native.enableDependencyPropagation=false
I guess that's somewhat related
I looked into hmpp some time ago but never really wrapped my head around this
Is there a specific reason you need it?
Yep, if I remove these 2 lines, I can
./gradlew publishToMavenLocal
But maybe it breaks something else?
a
Great. Thank you. I will check this. Im not sure, about these parameters. Looks like it is added by android studio kmm plugin.
Found this article, these flags are for sharing native code - https://kotlinlang.org/docs/mpp-share-on-platforms.html . I’m not familiar with this too. will try without these flags.
👍 1
m
Let me know what you find. I think (but I might be wrong) that it must be enabled in all upstream dependencies before enabling it in a project. Which means we'd need SQLDelight and Stately to enable the flag before we can turn it on in apollo-android.
a
hey, Martin, thank you for your help again. I removed these flags and everything look fine. I was able to create libraries for both android & ios platforms.
🎉 1
m
Niceee, thanks for the update!
For what it's worth, looks like HMPP is doing some progress... 🤞 https://github.com/touchlab/Stately/issues/46#issuecomment-781228876
a
🤞