首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >kotlin-gradle-plugin 1.6.0构建缓慢

kotlin-gradle-plugin 1.6.0构建缓慢
EN

Stack Overflow用户
提问于 2021-12-04 12:07:39
回答 1查看 366关注 0票数 3

当我将kotlin版本从1.5.30升级到1.6.0时,编译kotlin任务和kapt的任务非常耗时,而且只需要三分钟。我使用--info获取构建I日志。这个部分被调用了数千次,大约需要3分钟,而1.5.30没有这个问题。

代码语言:javascript
复制
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
EN

回答 1

Stack Overflow用户

发布于 2021-12-04 12:46:43

在Kotlin 1.6.0中引入的Android项目的编译速度有一个已知的倒退,请参阅KT-49910。也许这就是你所受的影响?

在上述问题中还提供了一种解决方法,即:

代码语言:javascript
复制
buildscript {
  dependencies {
    // Must go before the real KGP plugin!
    classpath("dev.zacsweers:kgp-160-patcher:1.0.0")
  }
}

这将在即将发布的1.6.10中修复。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70225446

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档