1. <i id='HBHqP'><tr id='HBHqP'><dt id='HBHqP'><q id='HBHqP'><span id='HBHqP'><b id='HBHqP'><form id='HBHqP'><ins id='HBHqP'></ins><ul id='HBHqP'></ul><sub id='HBHqP'></sub></form><legend id='HBHqP'></legend><bdo id='HBHqP'><pre id='HBHqP'><center id='HBHqP'></center></pre></bdo></b><th id='HBHqP'></th></span></q></dt></tr></i><div id='HBHqP'><tfoot id='HBHqP'></tfoot><dl id='HBHqP'><fieldset id='HBHqP'></fieldset></dl></div>

    2. <legend id='HBHqP'><style id='HBHqP'><dir id='HBHqP'><q id='HBHqP'></q></dir></style></legend>

      • <bdo id='HBHqP'></bdo><ul id='HBHqP'></ul>
      <tfoot id='HBHqP'></tfoot>

      <small id='HBHqP'></small><noframes id='HBHqP'>

    3. 在 Android Studio 2.2 中启用注释处理器选项

      时间:2023-07-26

      <tfoot id='vt8Ia'></tfoot>

            <bdo id='vt8Ia'></bdo><ul id='vt8Ia'></ul>

            <small id='vt8Ia'></small><noframes id='vt8Ia'>

                <tbody id='vt8Ia'></tbody>
              1. <legend id='vt8Ia'><style id='vt8Ia'><dir id='vt8Ia'><q id='vt8Ia'></q></dir></style></legend>
                <i id='vt8Ia'><tr id='vt8Ia'><dt id='vt8Ia'><q id='vt8Ia'><span id='vt8Ia'><b id='vt8Ia'><form id='vt8Ia'><ins id='vt8Ia'></ins><ul id='vt8Ia'></ul><sub id='vt8Ia'></sub></form><legend id='vt8Ia'></legend><bdo id='vt8Ia'><pre id='vt8Ia'><center id='vt8Ia'></center></pre></bdo></b><th id='vt8Ia'></th></span></q></dt></tr></i><div id='vt8Ia'><tfoot id='vt8Ia'></tfoot><dl id='vt8Ia'><fieldset id='vt8Ia'></fieldset></dl></div>
                本文介绍了在 Android Studio 2.2 中启用注释处理器选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                我正在尝试在我的项目中使用 java 8,为此我添加了 jack 编译器.

                I'm trying to use java 8 in my project and for that I added the jack compiler.

                启用杰克后,我开始遇到使用注释处理的库的问题,并在网上查看我读到我需要 android studio 2.2 和 com.android.tools.build:gradle:2.2.0-alpha6 来编译生成的库注释中的代码.

                After enabling jack I started having problems with libraries that use Annotation Processing and looking in the web I read that I need android studio 2.2 and com.android.tools.build:gradle:2.2.0-alpha6 to compile libraries that generate code from annotations.

                我下载了 Android Studio 2.2 preview 6 并将我的项目转换为它.之后我发现不再支持 apt gradle 插件,然后我需要将每个使用 apt 的依赖项更改为使用新的 annotationProcessor 选项.

                I download Android Studio 2.2 preview 6 and converted my project to it. And after that I discovered that the apt gradle plugin is not supported anymore and then I needed to change every dependency that use apt to the use the new annotationProcessor option.

                例如:

                apt "org.projectlombok:lombok:$rootProject.lombokVersion"
                

                annotationProcessor "org.projectlombok:lombok:$rootProject.lombokVersion"
                

                现在,如果我使用make project",项目编译没有问题,但如果我尝试执行它,我应该由注释生成的代码出现错误.

                Now if I use "make project" the project is compiled without problems, but if I try to execute it I have errors with the code that should be generated by the annotations.

                此外,当我打开项目时,我收到来自 lombok 插件的警告项目的注释处理似乎已禁用".当我打开项目设置并转到构建 -> 编译器"时,我找不到注释处理器.

                Also when I open the project I receive a warning from the lombok plugin "Annotation processing seems to be disabled for the project". When I open the project settings and go to "Build -> Compiler" I can't find Annotation Processors.

                所以,我的问题是:如何在 Android Studio 2.2 中启用注释处理器?这个功能被禁用了?如果是,如何从注解生成代码?

                So, my question is: How can I enable Annotation Processors in Android Studio 2.2? This feature was disabled? If yes, how can I generate the code from annotations?

                --编辑--我正在制作一个 PullRequest 来更改项目以使用 Java8 编译,您可以在此处查看 PR:https://github.com/jonathanrz/myexpenses-android/pull/57

                --EDIT-- I'm making a PullRequest to change the project to compile with Java8, you can check the PR here: https://github.com/jonathanrz/myexpenses-android/pull/57

                推荐答案

                关闭项目.在Welcome to Android Studio"对话框中点击右下角的Configure".

                Close the project. In the "Welcome to Android Studio" dialog click "Configure" in the bottom right corner.

                那么,

                设置 > 构建、执行、部署 > 编译器 > 注释处理器.勾选启用注释处理".

                Settings > Build, Execution, Deployment > Compiler > Annotation Processors. Tick 'Enable annotation processing'.

                如果这不起作用.从Welcome to Android Studio"对话框中删除项目并从新打开.

                If that does not work. Delete the project from "Welcome to Android Studio" dialog and open from new.

                为我工作.

                这篇关于在 Android Studio 2.2 中启用注释处理器选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:BeanNotOfRequiredTypeException 由于自动装配字段 下一篇:什么是注解以及它们如何在 Spring 这样的框架中实

                相关文章

                最新文章

              2. <legend id='rtaXJ'><style id='rtaXJ'><dir id='rtaXJ'><q id='rtaXJ'></q></dir></style></legend>

                    <bdo id='rtaXJ'></bdo><ul id='rtaXJ'></ul>

                  1. <i id='rtaXJ'><tr id='rtaXJ'><dt id='rtaXJ'><q id='rtaXJ'><span id='rtaXJ'><b id='rtaXJ'><form id='rtaXJ'><ins id='rtaXJ'></ins><ul id='rtaXJ'></ul><sub id='rtaXJ'></sub></form><legend id='rtaXJ'></legend><bdo id='rtaXJ'><pre id='rtaXJ'><center id='rtaXJ'></center></pre></bdo></b><th id='rtaXJ'></th></span></q></dt></tr></i><div id='rtaXJ'><tfoot id='rtaXJ'></tfoot><dl id='rtaXJ'><fieldset id='rtaXJ'></fieldset></dl></div>
                    <tfoot id='rtaXJ'></tfoot>

                    <small id='rtaXJ'></small><noframes id='rtaXJ'>