Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to suppress "warning: Ignoring InnerClasses attribute for an anonymous inner class" with Gradle?

Tags:

How to suppress "warning: Ignoring InnerClasses attribute for an anonymous inner class" with Gradle?

  • This not a duplicate question
  • This not during Proguard nor do I want to suppress using Proguard
  • I would like to suppress doing normal ./gradlew assembleDebug (since this is assertj-core - ./gradlew testDebug)

Dependency:

dependencies {
   testCompile "org.assertj:assertj-core:1.7.1"
}

Warning:

Dex: warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.assertj.core.internal.cglib.reflect.FastClassEmitter$3) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.

Something like:

tasks.withType(JavaCompile) {
    sourceCompatibility = JavaVersion.VERSION_1_7
    targetCompatibility = JavaVersion.VERSION_1_7

    configure(options) {
        compilerArgs << "-Xlint:-options"    // Turn off "missing" bootclasspath warning
    }
}

What compilerArgs can I add to suppress this warning?

References:

  • I have an answer here but none of these suppress this warning: How do I suppress warnings when compiling an android library with gradle?