question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build Android flavor with `-source 8 -target 8` (but still avoid Java 7+ APIs)

See original GitHub issue

Currently, our “Android” flavor of Guava supports 2 use cases:

  • Android users (API level 15 (Ice Cream Sandwich) and up)
  • Java 7 users

We are definitely not going to start using Java 8 APIs. Thus, we are not going to increase our minimum Android version to 24, nor are we going to require our users to enable library desugaring. In short: We’ll continue to support older versions of Android with no changes on users’ part.

However, we are investigating whether to stop supporting non-Android users who use Java 7. This would let us simplify some implementations (mainly by using lambdas), but more importantly, it would let us make some API improvements – like default methods on interfaces and type annotations (such as for nullness).

This is part of a larger effort by many Google projects to consider dropping support for Java 7. Please let us know if you anticipate problems from this change – mainly, if you are using Guava in your library or app and you support Java 7. Thanks.

(Please also spread the word. I will additionally announce this on our mailing list. Later, we may also try to introduce some warnings when Guava is run under Java 7.)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
cpovirkcommented, Feb 12, 2021

For most users, it’s probably a reasonable thing to enable. However, there are downsides in some cases. As I understand them, the downsides are:

0reactions
cpovirkcommented, Jun 16, 2021

Hi, thanks for reporting that. We have been in contact with the Google Cloud people, and we won’t be dropping support unless they are. Part of the reason for this warning was to share any information we could find with them.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use Java 8 language features and APIs - Android Developers
You can keep your project's source and target compatibility values set to Java 7, but you still need to compile using JDK 8....
Read more >
Is it possible to use Java 8 for Android development?
Android does not support Java 8. It only supports up to Java 7 (if you have kitkat) and still it doesn't have invokedynamic,...
Read more >
Compatibility Guide for JDK 8 - Oracle
This document discusses types of potential incompatibilities relating to the JDK 8 release of the Java platform.
Read more >
Upgrading your build from Gradle 7.x to the latest
Some plugins will break with this new version of Gradle, for example because they use internal APIs that have been removed or changed....
Read more >
How to Fix UnsupportedClassVersion Error in Java - Rollbar
How to Fix the Unsupported Class Version Runtime Error in Java ... therefore, harder to detect and prevent than compile-time errors [1].
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found