k

    KamilH

    11 months ago
    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:
    - 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:
    > 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:
    val commonMain by getting {
        dependencies {
            api(project(":data"))
        }
    }
    It seems like adding pod dependency in both
    data
    and
    shared
    modules like that:
    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

    11 months ago
    @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

    11 months ago
    Thanks @Igor Maric, but actually mine was a little bit different, I described it here and fortunately workaround posted here solved this