原因:项目中本来就有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')
}
}