Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

kotlin-gradle-plugin 1.6.0 build slow

Tags:

gradle

kotlin

When I upgraded the kotlin version from 1.5.30 to 1.6.0, the task of the compilekotlindebug task and kapt was time-consuming, and it was only three minutes away. I get the builid log by using --info. This part gets called thousands of time and take about 3 mins, while 1.5.30 do not have this problem.

file or directory 'F:\ProjectSample\android\sdk\build-types\debug\java', not found
file or directory 'F:\ProjectSample\android\sdk\build\generated\renderscript_source_output_dir\debug\out', not found
file or directory 'F:\ProjectSample\android\sdk\src\debug\kotlin', not found
file or directory 'F:\ProjectSample\android\sdk\src\debug\kotlin', not found
file or directory 'F:\ProjectSample\android\sdk\src\debug\java', not found
file or directory 'F:\ProjectSample\android\sdk\build-types\debug\java', not found
file or directory 'F:\ProjectSample\android\sdk\src\main\kotlin', not found
file or directory 'F:\ProjectSample\android\sdk\src\main\kotlin', not found
file or directory 'F:\ProjectSample\android\sdk\build-types\debug\java', not found
file or directory 'F:\ProjectSample\android\sdk\build\generated\renderscript_source_output_dir\debug\out', not found
file or directory 'F:\ProjectSample\android\sdk\build-types\debug\java', not found
file or directory 'F:\ProjectSample\android\sdk\build\generated\renderscript_source_output_dir\debug\out', not found
file or directory 'F:\ProjectSample\android\sdk\src\debug\kotlin', not found
file or directory 'F:\ProjectSample\android\sdk\src\debug\kotlin', not found
file or directory 'F:\ProjectSample\android\sdk\src\debug\java', not found
file or directory 'F:\ProjectSample\android\sdk\build-types\debug\java', not found
file or directory 'F:\ProjectSample\android\sdk\src\main\kotlin', not found
file or directory 'F:\ProjectSample\android\sdk\src\main\kotlin', not found
file or directory 'F:\ProjectSample\android\sdk\build-types\debug\java', not found
file or directory 'F:\ProjectSample\android\sdk\build\generated\renderscript_source_output_dir\debug\out', not found
file or directory 'F:\ProjectSample\android\sdk\build-types\debug\java', not found
file or directory 'F:\ProjectSample\android\sdk\build\generated\renderscript_source_output_dir\debug\out', not found
file or directory 'F:\ProjectSample\android\sdk\src\debug\kotlin', not found
file or directory 'F:\ProjectSample\android\sdk\src\debug\kotlin', not found
file or directory 'F:\ProjectSample\android\sdk\src\debug\java', not found
file or directory 'F:\ProjectSample\android\sdk\build-types\debug\java', not found
file or directory 'F:\ProjectSample\android\sdk\src\main\kotlin', not found
file or directory 'F:\ProjectSample\android\sdk\src\main\kotlin', not found
file or directory 'F:\ProjectSample\android\sdk\build-types\debug\java', not found
file or directory 'F:\ProjectSample\android\sdk\build\generated\renderscript_source_output_dir\debug\out', not found
like image 345
Kirin_CN Avatar asked Oct 24 '25 09:10

Kirin_CN


1 Answers

There is a known regression in compilation speed for Android projects introduced in Kotlin 1.6.0, see KT-49910. Maybe that's what you're affected by?

There also is a workaround provided in the above issue, namely:

buildscript {
  dependencies {
    // Must go before the real KGP plugin!
    classpath("dev.zacsweers:kgp-160-patcher:1.0.0")
  }
}

This will be fixed in the upcoming release 1.6.10.

like image 105
Endzeit Avatar answered Oct 25 '25 22:10

Endzeit



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!