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

Suresh Maidaragi

03/19/2024, 11:05 AM
Hi There, I am trying to generate a library using MavenLocal facing this issue
* What went wrong:
A problem was found with the configuration of task ':kmm-pw-ui-module:iosX64SourcesJar' (type 'Jar').
- Gradle detected a problem with the following location: '/Users/sureshmaidaragi/StudioProjects/kmm-pw-pitara/kmm-pw-ui-module/build/generated/moko/commonMain/src'.
Reason: Task ':kmm-pw-ui-module:iosX64SourcesJar' uses this output of task ':kmm-pw-ui-module: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 ':kmm-pw-ui-module:generateMRcommonMain' as an input of ':kmm-pw-ui-module:iosX64SourcesJar'.
2. Declare an explicit dependency on ':kmm-pw-ui-module:generateMRcommonMain' from ':kmm-pw-ui-module:iosX64SourcesJar' using Task#dependsOn.
3. Declare an explicit dependency on ':kmm-pw-ui-module:generateMRcommonMain' from ':kmm-pw-ui-module:iosX64SourcesJar' using Task#mustRunAfter.
Can someone help me to know what I have missed
a

alex009

03/20/2024, 3:44 AM
what version of moko-resources used?
s

Suresh Maidaragi

03/20/2024, 4:19 AM
0.23.0 Btw I am able to solve it by adding build.gradle.kts?,
Copy code
tasks.findByName("sourcesJar")!!.dependsOn("generateMRcommonMain")
tasks.findByName("iosArm64SourcesJar")!!.dependsOn("generateMRiosArm64Main")
tasks.findByName("iosSimulatorArm64SourcesJar")!!.dependsOn("generateMRiosSimulatorArm64Main")
tasks.findByName("iosX64SourcesJar")!!.dependsOn("generateMRiosX64Main")

afterEvaluate {
    tasks.named("androidReleaseSourcesJar") {
        dependsOn("generateMRandroidMain")
    }
}
a

alex009

03/20/2024, 4:23 AM
you can add dependency directly, yes
or you can try 0.24.0 alpha
s

Suresh Maidaragi

04/10/2024, 9:10 AM
0.24.0 required's migration process, so used above solution