Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Task 'prepareKotlinBuildScriptModel' not found in project

I have this error in my project Task 'prepareKotlinBuildScriptModel' not found in project I was looking at it online and found that adding the following lines will fix it

task prepareKotlinBuildScriptModel {

}

I tried adding the above to build.gradle.kts and following error ocured.

Function invocation 'task(...)' expected

I also tried tasks.register("prepareKotlinBuildScriptModel"){} which did not work too

what is the correct way of writing a task please.

thanks for your help in advance

thanks R

like image 460
BRDroid Avatar asked Feb 14 '26 12:02

BRDroid


1 Answers

This was occurring for me when I tried to add a new subproject to my main project.

I solved the issue by unlinking the project I had added manually then 'refreshing' the parent project the sub-project was inside. See this issue:

https://github.com/gradle/gradle/issues/14889#issuecomment-988134777

like image 127
Ryu S. Avatar answered Feb 16 '26 01:02

Ryu S.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!