-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: bring back Java 8 compatibility #267
fix: bring back Java 8 compatibility #267
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
065d56e
to
e0c69ff
Compare
} | ||
namespace 'com.google.maps.android.ktx.demo' | ||
} | ||
|
||
dependencies { | ||
implementation fileTree(dir: 'libs', include: ['*.jar']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wasn't used and AFAIK is considered a bad practice because makes the build less deterministic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that should rather not be on the Gradle file.
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
java-version: '21' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a bonus, you should be able to use latest version to compile the project, there is no reason to stick to an old java for the build 🤷
app/build.gradle
Outdated
@@ -43,18 +43,17 @@ android { | |||
} | |||
|
|||
compileOptions { | |||
sourceCompatibility = JavaVersion.VERSION_17 | |||
targetCompatibility = JavaVersion.VERSION_17 | |||
sourceCompatibility = JavaVersion.VERSION_11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested that you could even do 1.8, but it is deprecated to compile for java 8 with latest java versions 🤷
Java compiler version 21 has deprecated support for compiling with source/target version 8.
Try one of the following options:
1. [Recommended] Use Java toolchain with a lower language version
2. Set a higher source/target version
3. Use a lower version of the JDK running the build (if you're not using Java toolchain)
For more details on how to configure these settings, see https://developer.android.com/build/jdks.
To suppress this warning, set android.javaCompile.suppressSourceTargetDeprecationWarning=true in gradle.properties.
warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
Targeting java 11 is still a behavior change but will work for my project since, but from what I've seen a lot of projects still target java 1.8 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we try with Java 1.8 instead? A deprecation is the code is fine, we can keep it in mind for upcoming version bumps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e0c69ff
to
a83c21e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I will take a look at this with @dkhawk tomorrow.
## [5.1.1](v5.1.0...v5.1.1) (2024-07-09) ### Bug Fixes * bring back Java 8 compatibility ([#267](#267)) ([fded4c0](fded4c0))
🎉 This PR is included in version 5.1.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Thank you for opening a Pull Request!
Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #266 🦕