iOS build is failing with ```Reason: Task ':shared:kspKotlinIosSimulatorArm64' uses this output of t...
m
iOS build is failing with
Copy code
Reason: Task ':shared:kspKotlinIosSimulatorArm64' uses this output of task ':shared:generateMRcommonMain' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.

Possible solutions:
      1. Declare task ':shared:generateMRiosSimulatorArm64Main' as an input of ':shared:kspKotlinIosSimulatorArm64'.
      2. Declare an explicit dependency on ':shared:generateMRiosSimulatorArm64Main' from ':shared:kspKotlinIosSimulatorArm64' using Task#dependsOn.
      3. Declare an explicit dependency on ':shared:generateMRiosSimulatorArm64Main' from ':shared:kspKotlinIosSimulatorArm64' using Task#mustRunAfter.
none of possible solutions works. any help on how to solve this?
m
are you using cocoapods?
m
no I don’t
but error is there with and without cocoapods
I removed cocoapods just in order to try if it’s causing problems. no, problem either way
m
this is my conf for cocoapods in the shares module:
Copy code
cocoapods {
  summary = "Some description for the Shared Module"
  homepage = "Link to the Shared Module homepage"
  version = "1.0"
  ios.deploymentTarget = "14.1"
  podfile = project.file("../iosApp/Podfile")
  framework {
    baseName = "shared"
    isStatic = false
  }
}
m
thank you. Ill try but only thing I’m missing from there was
isStatic = false
. I hope it’ll work
it’s
false
by default. doesn’t work
still the same issue
m
paste your build.gradle.kts config of moko
m
Copy code
dependencies {
    commonMainApi(libs.moko.resources)
    commonMainApi(libs.moko.resources.compose)
}

multiplatformResources {
    multiplatformResourcesPackage = "tech.mapps.winthedaywinthelife"
}
q
I'm facing the same issue after integrating moko-resource in my project. Any help?
s
Hello. I was facing the same issue and I find a workaround. Put the following task in your
gradle
file and you should be ok. This will inject the explicit dependencies:
Copy code
project.afterEvaluate {
    tasks.named("kspKotlinIosSimulatorArm64") {
        dependsOn("generateMRiosSimulatorArm64Main")
    }
    tasks.named("kspKotlinIosX64") {
        dependsOn("generateMRiosX64Main")
    }
    tasks.named("kspKotlinIosArm64") {
        dependsOn("generateMRiosArm64Main")
    }
}
j
upgraded to kotlin = "2.1.0" and respective version of ksp and the issue dissapeared.
551 Views