添加greendao后,项目编译缓慢解决方法

原因:项目中本来就有realm,但是需要登录账号才能打开,但是新的功能在不登录状态下可以使用,所以就就使用了新的数据库greenDAO,
引发的问题就是,每次编译运行特别慢,需要8分钟以上
编译日志打印

> Task :vector:greendao
Execution optimizations have been disabled for task ':vector:greendao' to ensure correctness due to the following reasons:
  - Gradle detected a problem with the following location: 'E:\app\vector\src\main\java'. Reason: Task ':vector:compileRustCryptoDebugKotlin' uses this output of task ':vector:greendao' without 
declaring an explicit or implicit dependency. 
This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.6/userguide/validation_problems.html#implicit_dependency for more details about this problem.

任务 ':vector:kspRustCryptoDebugKotlin' 使用任务 ':vector:greendao' 的此输出,而没有声明显式或隐式依赖项。
这可能会导致产生不正确的结果,具体取决于任务的执行顺序。
解决方式:去掉包名vector:,把之后的参数按照下表填写

tasks.whenTaskAdded { task ->
    if (task.name.matches("kaptRustCryptoDebugKotlin")) {
        task.dependsOn('greendao')
    }
}
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容