2

I am using the Gradle Retrolambda Plugin in my Android library. The integration works well.

The Android Gradle Plugin, however, is annoying me. It announces that it can support Java 8 features, via de-sugaring. It suggests that I stop using Retrolambda:

WARNING: One of the plugins you are using supports Java 8 language features. To try the support built into the Android plugin, remove the following from your build.gradle: apply plugin: 'me.tatarka.retrolambda' To learn more, go to https://d.android.com/r/tools/java-8-support-message.html

For technical reasons, I have decided not to follow this suggestion. Retrolambda generates version 50 class files, while the AGP generates version 52 classfiles. The version 50 class files are compatible with a broader spread of consumers.

As per Google issue 147311698, I would like to permanently suppress this warning message, so that it doesn't clutter my build output. Is there some configuration / Groovy code I can use to target and suppress this specific message?

Jameson
  • 6,400
  • 6
  • 32
  • 53
  • I would imagine this is showing because you are using JDK 1.8 - does the message go away if you change your compilation target to JDK 1.6? – WoogieNoogie Jan 07 '20 at 21:47
  • 1
    @WoogieNoogie Ah, I didn't mention: I _am_ extensively using Java 8 features in source. So, setting source compatibility to a lower value isn't currently an option. – Jameson Jan 08 '20 at 00:40
  • Retrolambda lacks support for third-party libraries that use Java 8 language features (even if it may work in compatibility mode). You might be riding a dead horse (when reading the author's comments on the Github issue tracker). See [migrate from Retrolambda](https://developer.android.com/studio/write/java8-support?utm_source=android-studio#migrate_from_retrolambda). – Martin Zeitler Jan 11 '20 at 03:58

0 Answers0