Tomasz Krakowiak
12/08/2021, 5:02 AMTomasz Krakowiak
12/08/2021, 5:03 AMkotlin {
js("browser", IR) {
compilations["main"].defaultSourceSet.dependsOn(js(IR).compilations["main"].defaultSourceSet)
configurations[compilations["main"].apiConfigurationName].attributes.attribute(jsPlatformType, "browser")
configurations[compilations["main"].runtimeOnlyConfigurationName].attributes.attribute(jsPlatformType, "browser")
binaries.executable()
}
js("node", IR) {
nodejs { }
compilations["main"].defaultSourceSet.dependsOn(js(IR).compilations["main"].defaultSourceSet)
configurations[compilations["main"].apiConfigurationName].attributes.attribute(jsPlatformType, "node")
configurations[compilations["main"].runtimeOnlyConfigurationName].attributes.attribute(jsPlatformType, "node")
binaries.executable()
}
}
Error I am getting:
Execution failed for task ':app:generateMetadataFileForKotlinMultiplatformPublication'.
> Invalid publication 'kotlinMultiplatform':
- Variants 'browserApiElements-published' and 'jsApiElements-published' have the same attributes and capabilities. Please make sure either attributes or capabilities are different.
- Variants 'browserRuntimeElements-published' and 'jsRuntimeElements-published' have the same attributes and capabilities. Please make sure either attributes or capabilities are different.
- Variants 'browserApiElements-published' and 'nodeApiElements-published' have the same attributes and capabilities. Please make sure either attributes or capabilities are different.
- Variants 'browserRuntimeElements-published' and 'nodeRuntimeElements-published' have the same attributes and capabilities. Please make sure either attributes or capabilities are different.
Any ideas on how to solve it are welcome.Tomasz Krakowiak
12/08/2021, 5:08 AMkotlin {
js("browser", IR) {
compilations["main"].defaultSourceSet.dependsOn(js(IR).compilations["main"].defaultSourceSet)
configurations.all { if(name == compilations["main"].apiConfigurationName + "Elements-published") attributes.attribute(jsPlatformType, "browser") }
configurations.all { if(name == compilations["main"].runtimeOnlyConfigurationName + "Elements-published") attributes.attribute(jsPlatformType, "browser") }
binaries.executable()
}
js("node", IR) {
nodejs { }
compilations["main"].defaultSourceSet.dependsOn(js(IR).compilations["main"].defaultSourceSet)
configurations.all { if(name == compilations["main"].apiConfigurationName + "Elements-published") attributes.attribute(jsPlatformType, "node") }
configurations.all { if(name == compilations["main"].runtimeOnlyConfigurationName + "Elements-published") attributes.attribute(jsPlatformType, "node") }
binaries.executable()
}
}
I am getting slightly different error:
Execution failed for task ':app:generateMetadataFileForKotlinMultiplatformPublication'.
> Invalid publication 'kotlinMultiplatform':
- Variants 'browserRuntimeElements-published' and 'jsRuntimeElements-published' have the same attributes and capabilities. Please make sure either attributes or capabilities are different.
- Variants 'browserRuntimeElements-published' and 'nodeRuntimeElements-published' have the same attributes and capabilities. Please make sure either attributes or capabilities are different.
Variants 'browserRuntimeElements-published' and 'nodeRuntimeElements-published' have the same attributes and capabilities.
is now most confusing.Vampire
12/08/2021, 10:50 AMoutgoingVariants
can help you shed some light on itTomasz Krakowiak
12/08/2021, 5:51 PMkotlin {
js("browser", IR) {
compilations["main"].defaultSourceSet.dependsOn(js(IR).compilations["main"].defaultSourceSet)
configurations.all { if(name == compilations["main"].apiConfigurationName + "Elements") attributes.attribute(jsPlatformType, "browser") }
configurations.all { if(name == "browserRuntimeElements") attributes.attribute(jsPlatformType, "browser") }
binaries.executable()
}
js("node", IR) {
nodejs { }
compilations["main"].defaultSourceSet.dependsOn(js(IR).compilations["main"].defaultSourceSet)
configurations.all { if(name == compilations["main"].apiConfigurationName + "Elements") attributes.attribute(jsPlatformType, "node") }
configurations.all { if(name == "nodeRuntimeElements") attributes.attribute(jsPlatformType, "node") }
binaries.executable()
}
}