Thread
#multiplatform
    jacksonfdam

    jacksonfdam

    1 month ago
    Guys, I am having some issues with multiple KMM modules depending on other KMM modules.
    But Im using Kotlin 1.6.21 Gradle 7.3.3 and Android Gradle 7.2.2
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Could not determine the dependencies of task ':shared:linkDebugFrameworkIosSimulatorArm64'.
    > Could not resolve all task dependencies for configuration ':shared:iosSimulatorArm64CompileKlibraries'.
       > Could not resolve app.gmal:sharedstorage:1.0.2-wip05.
         Required by:
             project :shared
          > No matching variant of app.gmal:sharedstorage:1.0.2-wip05 was found. The consumer was configured to find a usage of 'kotlin-api' of a library, preferably optimized for non-jvm, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native', attribute 'org.jetbrains.kotlin.native.target' with value 'ios_simulator_arm64' but:
              - Variant 'releaseApiElements-published' capability app.gmal:sharedstorage:1.0.2-wip05 declares an API of a library:
                  - Incompatible because this component declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native'
                  - Other compatible attributes:
                      - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                      - Doesn't say anything about org.jetbrains.kotlin.native.target (required 'ios_simulator_arm64')
              - Variant 'releaseRuntimeElements-published' capability app.gmal:sharedstorage:1.0.2-wip05 declares a runtime of a library:
                  - Incompatible because this component declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native'
                  - Other compatible attributes:
                      - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                      - Doesn't say anything about org.jetbrains.kotlin.native.target (required 'ios_simulator_arm64')
       > Could not resolve app.gmal:networkinglib:1.0.5-wip12.
         Required by:
             project :shared
          > No matching variant of app.gmal:networkinglib:1.0.5-wip12 was found. The consumer was configured to find a usage of 'kotlin-api' of a library, preferably optimized for non-jvm, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native', attribute 'org.jetbrains.kotlin.native.target' with value 'ios_simulator_arm64' but:
              - Variant 'releaseApiElements-published' capability app.gmal:networkinglib:1.0.5-wip12 declares an API of a library:
                  - Incompatible because this component declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native'
                  - Other compatible attributes:
                      - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                      - Doesn't say anything about org.jetbrains.kotlin.native.target (required 'ios_simulator_arm64')
              - Variant 'releaseRuntimeElements-published' capability app.gmal:networkinglib:1.0.5-wip12 declares a runtime of a library:
                  - Incompatible because this component declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native'
                  - Other compatible attributes:
                      - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                      - Doesn't say anything about org.jetbrains.kotlin.native.target (required 'ios_simulator_arm64')
    
    * Try:
    > Run with --stacktrace option to get the stack trace.
    > Run with --info or --debug option to get more log output.
    > Run with --scan to get full insights.
    
    * Get more help at <https://help.gradle.org>
    
    Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
    
    You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
    
    See <https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings>
    
    BUILD FAILED in 884ms
    All libraries have the same configuration, If I invoke directly from the app (Android/iOS) it works, but If I call from another KMM module, it fails.
    andylamax

    andylamax

    1 month ago
    Most likely you have target incompatibility issues. Is this project opensource? I can help you look and point out where the incompatibility happens
    jacksonfdam

    jacksonfdam

    1 month ago
    No, its private 😞