Hi everyone, I’m trying to setup a kotlin multi pl...
# multiplatform
f
Hi everyone, I’m trying to setup a kotlin multi platform project to generate java and js code from some kotlin classes. In general everything is working with one little problem remaining. in the gradle root folder a file called
build
exists, that file cannot be renamed or removed. it seems like that this file clashes with the generation of js code from the kotlin code. when the multi platform plugin runs an error occurs saying that
build
is not a directory but a file. when the file gets temporarily deleted the build works fine an produces the js code I wonder whether it is possible to somehow tell he multi platform plugin, to use a different folder for the build. the
build.gradle
file of the root directory already contains an entry defining that the default build directory is different to
build
, but somehow that information is not used when the js code gets generated. the error message
Copy code
* What went wrong:
A problem was found with the configuration of task ':ys-kcart:jsPackageJson' (type 'KotlinPackageJsonTask').
  - In plugin 'org.jetbrains.kotlin.gradle.scripting.internal.ScriptingKotlinGradleSubplugin' type 'org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinPackageJsonTask' property 'packageJson' is not writable because '/Users/fbernstein/repos/ysura_crm_gradle/build/js/packages/ys-kcart/package.json' ancestor '/Users/fbernstein/repos/ysura_crm_gradle/build' is not a directory.
    
    Reason: Cannot create parent directories that are existing as file.
    
    Possible solution: Configure 'packageJson' to point to the correct location.
    
    For more information, please refer to <https://docs.gradle.org/8.6/userguide/validation_problems.html#cannot_write_output> in the Gradle documentation.

* Try:
> Run with --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at <https://help.gradle.org>.

* Exception is:
org.gradle.internal.execution.WorkValidationException: A problem was found with the configuration of task ':ys-kcart:jsPackageJson' (type 'KotlinPackageJsonTask').
  - In plugin 'org.jetbrains.kotlin.gradle.scripting.internal.ScriptingKotlinGradleSubplugin' type 'org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinPackageJsonTask' property 'packageJson' is not writable because '/Users/fbernstein/repos/ysura_crm_gradle/build/js/packages/ys-kcart/package.json' ancestor '/Users/fbernstein/repos/ysura_crm_gradle/build' is not a directory.
    
    Reason: Cannot create parent directories that are existing as file.
    
    Possible solution: Configure 'packageJson' to point to the correct location.