Andrey Larionov
12/21/2023, 10:59 AM:wasmJsBrowserDistribution
> Task :composeApp:wasmJsBrowserDistribution
> Task :shared:compileProductionExecutableKotlinWasmJs UP-TO-DATE
> Task :shared:wasmJsProductionExecutableCompileSync
> Task :shared:wasmJsBrowserProductionExecutableDistributeResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
A problem was found with the configuration of task ':shared:wasmJsBrowserProductionExecutableDistributeResources' (type 'Copy').
- Gradle detected a problem with the following location: '/Users/xxx/xxx/projectName/build/js/packages/composeApp/kotlin/composeApp.wasm'.
Reason: Task ':shared:wasmJsBrowserProductionExecutableDistributeResources' uses this output of task ':composeApp:wasmJsProductionExecutableCompileSync' 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 ':composeApp:wasmJsProductionExecutableCompileSync' as an input of ':shared:wasmJsBrowserProductionExecutableDistributeResources'.
2. Declare an explicit dependency on ':composeApp:wasmJsProductionExecutableCompileSync' from ':shared:wasmJsBrowserProductionExecutableDistributeResources' using Task#dependsOn.
3. Declare an explicit dependency on ':composeApp:wasmJsProductionExecutableCompileSync' from ':shared:wasmJsBrowserProductionExecutableDistributeResources' using Task#mustRunAfter.
I did this about 5 times before and there were no errors. However, when I manually added
tasks.named<Copy>("wasmJsBrowserProductionExecutableDistributeResources") {
dependsOn(":composeApp:wasmJsProductionExecutableCompileSync")
}
the problem disappeared. I didn’t find a specific issue so I decided let you knowArtem Kobzar
12/21/2023, 12:09 PM