android - 任何处理器都无法识别 Kapt 选项
问题描述
我不明白为什么 kotlin 注释处理器无法解析这些参数。
我的 build.gradle.kts 的相关部分
plugins {
id("kotlin-kapt")
}
android {
defaultConfig {
kapt {
arguments {
arg("room.incremental", "true")
arg("room.schemaLocation", "$projectDir/schemas")
}
}
}
}
dependencies {
implementation("androidx.room:room-runtime:${Versions.room_version}") // room_version = "2.2.4"
kapt("androidx.room:room-compiler:${Versions.room_version}")
implementation("androidx.room:room-ktx:${Versions.room_version}")
}
我得到的确切警告是
> Task :app:kaptDebugKotlin
warning: The following options were not recognized by any processor: '[room.schemaLocation, kapt.kotlin.generated, room.incremental]'
The following options were not recognized by any processor: '[room.schemaLocation, kapt.kotlin.generated, room.incremental]'
解决方案
如果您的代码不使用您的任何Annotation processor's
注释,则 kapt 任务将被跳过并且不会调用注释处理器,因此您传递的选项将被忽略,因为没有调用的注释处理器(如果有)对它们感兴趣。
推荐阅读
- bash - 使用带有名称和 url 以及自动递增名称的 CSV 下载 PDF 的 Bash 脚本
- python - 正则表达式,有线电子邮件匹配的否定环视
- select - 如何执行多个 SELECT 的结果
- solidity - 如何在 Solidity 中初始化映射,最佳实践是什么?
- php - 泰米尔语字体在 tcpdf pdf 生成中不起作用
- spring - 在本地主机上运行 SpringBoot 应用程序时出错:创建名称为“entityManagerFactory”的 bean 时出错
- javascript - 用户可以通过登录另一个应用程序来登录 Firebase 应用程序吗?
- android - 尝试使用 FolioReader 打开原始文件时应用程序崩溃
- discord.js - Discord.js 分页限制
- python - 当我在 django 应用程序中输入时,我不断收到路径错误