https://kotlinlang.org logo
k

KamilH

10/18/2021, 12:49 PM
Do you know any example of multimodule project that uses any pod in the bottom layer module? I would like to achieve a following structure:
Copy code
- data - has pod dependency on any library, eg. AFNetworking and is using this
- shared - has dependency on data module and uses its code
- iosApp - has dependency on shared module and uses its code
I’m trying to connect the dots, but when I’m trying to build an app I’m getting following error:
Copy code
> Task :data:cinteropAFNetworkingIosX64 FAILED
Exception in thread "main" java.lang.Error: /var/folders/2q/gjhd6ng16j51tnmw772w02k40000gp/T/10252343052379226466.m:1:9: fatal error: module 'AFNetworking' not found
Currently, in the
shared
module I simply do:
Copy code
val commonMain by getting {
    dependencies {
        api(project(":data"))
    }
}
It seems like adding pod dependency in both
data
and
shared
modules like that:
Copy code
pod("AFNetworking") {
    version = "~> 4.0.0"
}
solves a problem. It seems like a workaround, but I haven’t found a better solution so far, so it’s good enough for me
i

Igor Maric

10/19/2021, 2:31 PM
@KamilH This is a know issue if you use xcode 13, you can track it here. https://youtrack.jetbrains.com/issue/KT-48990
I have tried gradle and kotlin version 1.6.0-RC but other issues arise so it is maybe better to wait for official fix.
k

KamilH

10/19/2021, 2:38 PM
Thanks @Igor Maric, but actually mine was a little bit different, I described it here and fortunately workaround posted here solved this