https://kotlinlang.org logo
#ios
Title
# ios
s

Samuel Bichsel

02/18/2021, 10:59 AM
Hello, I just tried to update to Kotlin 1.4.30. Doing that breaks the iOS Builds with the following error:
Copy code
Execution failed for task ':shared:linkDebugFrameworkIosX64'.
> Following dependencies exported in the debugFramework binary are not specified as API-dependencies of a corresponding source set:
  
  Project :dreimultiplatform
  
  Please add them in the API-dependencies and rerun the build.
build.gradle:
Copy code
ios("ios") {
        binaries.withType(org.jetbrains.kotlin.gradle.plugin.mpp.Framework).all {
            transitiveExport = true
            export(project(":dreimultiplatform"))
        }
    }

    cocoapods {
        // Configure fields required by CocoaPods.
        summary = "Multiplatform Redux Sample"
        homepage = "<https://github.com/dreipol/multiplatform-redux-sample>"
        ios.deploymentTarget = "13.0"
        frameworkName = "ReduxSampleShared"
    }

    sourceSets["commonMain"].dependencies {
        api project(":dreimultiplatform")
}
Before it used to work. Does anyone had the same problem?
p

ptsiogas

03/16/2022, 10:48 AM
Hi, I am facing a similar problem, have you found a solution?
s

Samuel Bichsel

03/16/2022, 10:51 AM
Yes. The problem was, that different Kotlin or other dependency versions where used in the api project and the project itself. Just be sure that you use the same versions everywhere kotlin and thirdparty dependencies like ktor….
p

ptsiogas

03/16/2022, 10:54 AM
So if this is the case we get a random error in the iOS like the above? This is very hard to debug.
s

Samuel Bichsel

03/16/2022, 10:54 AM
Unfortunately yes. 🙂
p

ptsiogas

03/16/2022, 10:57 AM
Thirdparty dependencies like ktor should have a match with Main project if they are added as “implementation” at the “api” project?
s

Samuel Bichsel

03/16/2022, 12:02 PM
So if you use ktor in the main project and the api project, they should have the same version. I don’t know if that is true for all dependencies, but that’s how we fixed it in our case.
👍 1
p

ptsiogas

03/16/2022, 12:20 PM
It is surely a field/feature that has a lot of development. It is also super important because people would like to reuse its KMM modules
4 Views