Compiler options missing in Android Studio >= 0.8.2

为君一笑 提交于 2019-12-05 20:11:45

问题


Recently I upgraded my Android Studio to 0.8.2. Now, my android-annotations based project fails to build. It seems like annotation processing is disabled somehow. It seems the project compiler settings have been changed, the option to turn annotation processing on/off is nowhere to be found...

I can't expand the 'Compiler' option as I could before:

Where have they put these options?


回答1:


This is a little late, but for me, it's under

File -> Other Settings -> Default Settings -> Compiler

This compiler has dropdown options, including Annotation Processors.




回答2:


In Android Studio 3.1.2 this setting is under:

File -> Other Settings -> Default Settings... -> Build, Execution, Deployment -> Compiler -> Java Compiler -> Additional command line parameters


Update

For more recent versions of Android Studio [tested on Android Studio 3.5 but probably starting from 3.4 according to Joel's comment] this setting is under:

File -> Other Settings -> Settings for New Projects... -> Build, Execution, Deployment -> Compiler -> Java Compiler -> Additional command line parameters


For existing projects it seems to me that the only option is to implement the solution described in these two answers A1 and A2, modifying the build.gradle file wrapping around allprojects or not based on your needs:

allprojects {
    gradle.projectsEvaluated {
        tasks.withType(JavaCompile) {
            options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
        }
    }
}

More details about Gradle's Multi-Project Builds can be found here on their official website



来源:https://stackoverflow.com/questions/24787751/compiler-options-missing-in-android-studio-0-8-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!