-
Notifications
You must be signed in to change notification settings - Fork 127
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
Update AGP and JAVA Version to make it compatible with Gradle 8.7 and Add support for Streaming #179
Conversation
The version of Android Gradle Plugin (AGP) has been updated from 7.4.2 to 8.5.1 in the gradle.properties file. Additionally, the source and target Java compatibility have been changed from version 17 to version 21 in the build.gradle file.
The version of Android Gradle Plugin (AGP) has been updated from 7.4.2 to 8.5.1 in the gradle.properties file. Additionally, the source and target Java compatibility have been changed from version 17 to version 21 in the build.gradle file.
The sourceCompatibility and targetCompatibility in build.gradle files have been updated from JavaVersion 17 to JavaVersion 21. This change reflects the need to align with recent advancements in the Java language and its environment.
The Java version used in the CI/CD workflow has been updated from version '17' to '21'. This change is reflected in the example-app.yml file under the GitHub workflows directory. This update ensures compatibility with the latest Java features and performance improvements.
Sorry for multiple commits. Forgot to change version in example file and also in workflow (Using Java 21) |
Updated Android build files to use newer Java version and integrated Kotlin options. Enhanced the main Dart file to include NFC stream functionality. Added additional NFC handling functions in the Flutter plugin. Streamlined some code blocks for readability and efficiency.
example/android/app/build.gradle
Outdated
@@ -30,8 +30,8 @@ android { | |||
compileSdkVersion 34 | |||
|
|||
compileOptions { | |||
sourceCompatibility JavaVersion.VERSION_17 | |||
targetCompatibility JavaVersion.VERSION_17 | |||
sourceCompatibility JavaVersion.VERSION_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.
We can't downgrade this again, as it will cause breakage downstream.
See: #127 (comment)
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'll give an update soon. Problem is I'm getting issue like Java Version 21 and Kotlin Version 17. I tried fixing it but the error didn't compile. Maybe I need to clean everything and try again.
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 changed the version back to 17 and it's working but automated checks are failing. I can build the app without issues but here Github Actions are failing without proper error.
This commit includes updates to Gradle and Java versions across multiple files. The Gradle version has been updated from 8.7 to 8.9 in both the main android and example app files. Additionally, Java version for source and target compatibility has been changed from 1.8 to 17, reflecting the corresponding change in the GitHub workflow.
Sorry for the late reply. I'm reluctant to upgrade AGP version, since AGP 7.4.2 is the latest version that does not enforce so-called And then, there are complex dependencies between gradle, AGP, Java and Kotlin version. I did not find a good solution to this yet. |
Just need to set AGP to version 8.5.2 & below compileOptions flag need to add this flag & it'll fix the build issue.
|
Thing is, the JVM target should actually be Java 8, in order to support the lower SDK levels (Android 7.1, but you can go lower with desugaring). I'm pretty sure my comment above is wrong about this, and this should be possible: compileSdk 35
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
} I've just lowered these today for most of our internal plugins, and they build just fine with AGP 8.7.1. EDIT |
Now it requires at least Java 17 and Gradle 8.9. See #179, #184, #187 Signed-off-by: Shengqi Chen <[email protected]>
I have now upgraded AGP to 8.7.0 in the latest master commit. You may want to try it (and remove the changes from your PR). As for the streaming support, @dangfan is also actively working on it. Maybe you can have more discussion before we merge that. |
The version of Android Gradle Plugin (AGP) has been updated from 7.4.2 to 8.5.1 in the gradle.properties file. Additionally, the source and target Java compatibility have been changed from version 17 to version 21 in the build.gradle file.
This will fix issue with incompatible Java Version which was 17