当我去描述的位置时,我找不到它
6 回答
您必须关闭项目并从“Welcome to Android Studio”页面访问默认首选项,您将可以找到“Annotation Processors”部分。
有关 Android 2.2 的其他问题的更多信息(例如
在 Android Studio 2.2 中启用 Annotation Processors 选项),您还可以在其中找到其他提示,例如从欢迎页面中删除所有项目、使用无效缓存和重新启动等。
无论如何,无论消息多么无聊,Lombok APT 似乎都能正常运行。该错误已在https://github.com/mplushnikov/lombok-intellij-plugin/issues/264发布。
我终于找到了调整!
似乎问题出在您在启用注释处理器之前创建项目时。
退出 Android Studio 并编辑文件<your project folder>/.idea/compiler.xml
。
你应该找到:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
...
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
</project>
您应该设置enabled
为true
,无聊的消息就会消失!
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
...
<annotationProcessing>
<!-- This is the line where to set enabled to true -->
<profile default="true" name="Default" enabled="true">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
</project>
您可以在 File -> Other Settings -> Default Settings -> Build, Execution, Deployment -> Compiler -> Annotation Processors 下找到该选项
- Android Studio - 文件 - 关闭项目
- 配置 - 设置 - 构建、执行、部署 - 编译器 - 注释处理器 - 启用注释处理。
- 打开项目 - 构建 - 重建项目。
从@Tudor Pop amswer 复制这是正确的答案android-studio-2-3。您可以在 File -> Other Settings -> Default Settings -> Build, Execution, Deployment -> Compiler -> Annotation Processors 下找到该选项
对我来说,Android Studio 3.4.x 的工作原理是通过以下步骤启用注释处理:
- 文件 - 关闭项目
- 配置 -> 设置 -> 构建、执行、部署 -> 编译器 -> 注释处理器 - 启用注释处理
然后需要将compiler.xml文件添加到项目文件夹中的.idea文件夹中。这就是 compiler.xml 的样子:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile default="true" name="Default" enabled="true" />
</annotationProcessing>
</component>
</project>