How to set custom Java compiler args on an Android project?

前端 未结 1 462
别跟我提以往
别跟我提以往 2021-01-26 04:47

I\'m putting the following at the end of my project gradle file:

gradle.projectsEvaluated {
    tasks.withType(JavaCompile) {
        options.compilerArgs += 
           


        
相关标签:
1条回答
  • 2021-01-26 05:04

    I googled your problem and found this post that described your problem and the solution looks like this:

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

    As is seems the gradle build is different for android projects than for java projects and you can't access the task CompileJava itself as stated in my first comment.

    0 讨论(0)
提交回复
热议问题