-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Update to Compose 1.8 #1555
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 to Compose 1.8 #1555
Conversation
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.
Hello @dturner, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
Summary of Changes
This pull request updates the Compose version to 1.8 across multiple projects (JetLagged, JetNews, Jetcaster, Jetchat, Jetsnack, and Reply). It also addresses several issues encountered during the update, including changes required by the version catalog update plugin, Gradle version updates, and necessary code modifications due to API changes in Compose Material3 Adaptive. The script duplicate_version_config.sh
was modified to stop copying the spotless config, and the script verify_samples.sh
was updated to use the spotlessCheck
task from each app's build.gradle.kts
.
Highlights
- Compose Version Update: Updates all projects to Compose version 1.8.
- Version Catalog Update Plugin: Removes unsupported
keep
properties from build configurations due to changes in the version catalog update plugin (0.8.5 to 1.0.0). - Gradle Version Update: Updates the Gradle version from 8.10.2 to 8.13 to meet the minimum supported version.
- Code Modifications for Material3 Adaptive: Wraps
navigate
calls incoroutineScope.launch
due toThreePaneScaffoldNavigator.navigateBack
becoming a suspend function. Also, updates property name fromcontent
tocontentKey
. - JDK Desugar Update: Updates
jdkDesugar
to version 2.1.5 to support compileSdk=35 or later. - Spotless Plugin Configuration: Updates
scripts/verify_samples.sh
to use thespotlessCheck
task from each app'sbuild.gradle.kts
.
Changelog
Click here to see the changelog
- JetLagged/buildscripts/toml-updater-config.gradle
- Removed unsupported
keepUnusedLibraries
andkeepUnusedPlugins
properties.
- Removed unsupported
- JetLagged/gradle/libs.versions.toml
- Updated versions for accompanist, androidGradlePlugin, androidx-activity-compose, androidx-compose-bom, androidx-corektx, androidx-navigation, coroutines, hilt, horologist, kotlin, ksp, roborazzi, room, and version-catalog-update.
- Added android-material3 version.
- JetLagged/gradle/wrapper/gradle-wrapper.properties
- Updated Gradle distribution URL to gradle-8.13-bin.zip.
- JetNews/buildscripts/toml-updater-config.gradle
- Removed unsupported
keepUnusedLibraries
andkeepUnusedPlugins
properties.
- Removed unsupported
- JetNews/gradle/libs.versions.toml
- Updated versions for accompanist, androidGradlePlugin, androidx-activity-compose, androidx-compose-bom, androidx-corektx, androidx-navigation, coroutines, hilt, horologist, kotlin, ksp, roborazzi, room, and version-catalog-update.
- Added android-material3 version.
- JetNews/gradle/wrapper/gradle-wrapper.properties
- Updated Gradle distribution URL to gradle-8.13-bin.zip.
- Jetcaster/buildscripts/toml-updater-config.gradle
- Removed unsupported
keepUnusedLibraries
andkeepUnusedPlugins
properties.
- Removed unsupported
- Jetcaster/gradle/libs.versions.toml
- Updated versions for accompanist, androidGradlePlugin, androidx-activity-compose, androidx-compose-bom, androidx-corektx, androidx-navigation, coroutines, hilt, horologist, kotlin, ksp, roborazzi, room, and version-catalog-update.
- Updated jdkDesugar to 2.1.5
- Added android-material3 version.
- Removed duplicate android-material3 entry under libraries.
- Jetcaster/gradle/wrapper/gradle-wrapper.properties
- Updated Gradle distribution URL to gradle-8.13-bin.zip.
- Removed copyright header.
- Jetcaster/mobile/src/main/java/com/example/jetcaster/ui/home/Home.kt
- Updated copyright year to 2020-2025.
- Added import for
NavigableSupportingPaneScaffold
- Simplified
isMainPaneHidden()
function. - Added default value for
verticalHingePolicy
incalculateScaffoldDirective()
. - Simplified
getExcludedVerticalBounds()
function. - Added trailing commas to function calls.
- Wrapped
navigator.navigateBack()
andnavigator.navigateTo()
calls incoroutineScope.launch
. - Changed
navigator.currentDestination?.content
tonavigator.currentDestination?.contentKey
.
- Jetchat/buildscripts/toml-updater-config.gradle
- Removed unsupported
keepUnusedLibraries
andkeepUnusedPlugins
properties.
- Removed unsupported
- Jetchat/gradle/libs.versions.toml
- Updated versions for accompanist, androidGradlePlugin, androidx-activity-compose, androidx-compose-bom, androidx-corektx, androidx-navigation, coroutines, hilt, horologist, kotlin, ksp, roborazzi, room, and version-catalog-update.
- Added android-material3 version.
- Jetchat/gradle/wrapper/gradle-wrapper.properties
- Updated Gradle distribution URL to gradle-8.13-bin.zip.
- Jetsnack/buildscripts/toml-updater-config.gradle
- Removed unsupported
keepUnusedLibraries
andkeepUnusedPlugins
properties.
- Removed unsupported
- Jetsnack/gradle/libs.versions.toml
- Updated versions for accompanist, androidGradlePlugin, androidx-activity-compose, androidx-compose-bom, androidx-corektx, androidx-navigation, coroutines, hilt, horologist, kotlin, ksp, roborazzi, room, and version-catalog-update.
- Added android-material3 version.
- Jetsnack/gradle/wrapper/gradle-wrapper.properties
- Updated Gradle distribution URL to gradle-8.13-bin.zip.
- Reply/buildscripts/toml-updater-config.gradle
- Removed unsupported
keepUnusedLibraries
andkeepUnusedPlugins
properties.
- Removed unsupported
- Reply/gradle/libs.versions.toml
- Updated versions for accompanist, androidGradlePlugin, androidx-activity-compose, androidx-compose-bom, androidx-corektx, androidx-navigation, coroutines, hilt, horologist, kotlin, ksp, roborazzi, room, and version-catalog-update.
- Added android-material3 version.
- Reply/gradle/wrapper/gradle-wrapper.properties
- Updated Gradle distribution URL to gradle-8.13-bin.zip.
- scripts/duplicate_version_config.sh
- Commented out the lines that copy
init.gradle.kts
to each project's buildscripts directory.
- Commented out the lines that copy
- scripts/libs.versions.toml
- Updated versions for accompanist, androidGradlePlugin, androidx-activity-compose, androidx-compose-bom, androidx-corektx, androidx-navigation, coroutines, hilt, horologist, kotlin, ksp, roborazzi, room, and version-catalog-update.
- Added android-material3 version.
- Added spotless plugin
- scripts/toml-updater-config.gradle
- Removed unsupported
keepUnusedLibraries
andkeepUnusedPlugins
properties.
- Removed unsupported
- scripts/verify_samples.sh
- Removed
--init-script buildscripts/init.gradle.kts
from thespotlessCheck
command.
- Removed
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
A version bump so grand,
Across projects, hand in hand.
Compose evolves,
As code resolves,
A fresher, smoother Android land.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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.
Code Review
This pull request updates the Compose version across multiple projects and addresses several compatibility issues. The changes seem well-documented and the resolutions are clearly explained in the pull request description. However, there are a few areas that could be improved.
Summary of Findings
- jdkDesugar version update: The jdkDesugar version is updated in Jetcaster but not consistently across all projects. It should be updated in all projects to ensure compatibility with compileSdk=35.
- Inconsistent android-material3 dependency declaration: The android-material3 dependency is added as a library in some
libs.versions.toml
files but also declared directly in theJetcaster/gradle/libs.versions.toml
file, which is then removed. This inconsistency should be resolved. - Coroutine scope usage for navigation: The fix for the
navigateBack
suspend function involves wrapping calls incoroutineScope.launch
. Ensure that the coroutine scope being used is properly scoped to the lifecycle of the composable to avoid potential memory leaks or unexpected behavior. - Spotless config: The PR description mentions that the spotless config is no longer in a separate init file. However, the
duplicate_version_config.sh
script still has commented-out lines that attempt to copy theinit.gradle.kts
file. This discrepancy should be addressed.
Merge Readiness
The pull request is almost ready for merging. However, the inconsistencies with the jdkDesugar
version and android-material3
dependency declaration need to be addressed. Additionally, the duplicate_version_config.sh
script should be updated to reflect the changes in the spotless configuration. Once these issues are resolved, the pull request should be good to merge. I am unable to approve this pull request, and recommend that others review and approve this code before merging.
I have updated all projects to the latest version of Compose (1.8) which was released today. More info here.
I encountered the following issues and have documented their resolutions below:
Could not get unknown property 'keepUnusedLibraries'
After updating the version-catalog-update-plugin from 0.8.5 to 1.0.0 I received the following error:
Cause: The plugin no longer supports various
keep
properties.Fix: Remove the unsupported
keep
properties from the build config.More info: here and here
Minimum supported Gradle version is 8.11.1. Current version is 8.10.2.
Fix: Search and replace
gradle-8.10.2-bin.zip
withgradle-8.13-bin.zip
throughout repoSuspend function 'suspend fun navigateBack(backNavigationBehavior: BackNavigationBehavior): Boolean' can only be called from a coroutine or another suspend function.
Full error:
Root cause:
ThreePaneScaffoldNavigator.navigateBack
became a suspend fun.Fix: Wrap
navigate
calls incoroutineScope.launch
Unresolved reference ThreePaneScaffoldNavigator.currentDestination.content
Cause: Property name changed from
content
tocontentKey
Fix: Change to
contentKey
Core library desugaring runtime library version 1.2.2 does not support compileSdk=35 or later; please upgrade to version 2.1.5
Fix: Update jdkDesugar to 2.1.5
Failed to apply plugin 'com.diffplug.spotless'.
Cause:
scripts/verify_samples.sh
still assumed that the spotless config would be in a separate init file, but no longer does following this PR.Fix: Update
scripts/verify_samples.sh
to use thespotlessCheck
task from each app'sbuild.gradle.kts
.Spotless formatting issues
Home.kt
from Jetcaster had formatting issues. RunningspotlessApply
fixes the issues but also changes code that isn't directly related to the version updates and makes reviewing difficult. For the purposes of reviewing, the original changes are in this commit.