Skip to content

Conversation

@riggaroo
Copy link
Collaborator

#192 based on this, trying to fix build with nav3 runtime still crashing:


2026-01-23 10:10:52.904 19121-19121 AndroidRuntime          com.android.developers.androidify    E  FATAL EXCEPTION: main (Fix with AI)
                                                                                                    Process: com.android.developers.androidify, PID: 19121
                                                                                                    java.lang.NoSuchMethodError: No static method rememberViewModelStoreNavEntryDecorator(Landroidx/lifecycle/ViewModelStoreOwner;Lkotlin/jvm/functions/Function0;Landroidx/compose/runtime/Composer;II)Landroidx/navigation3/runtime/NavEntryDecorator; in class Landroidx/lifecycle/viewmodel/navigation3/ViewModelStoreNavEntryDecoratorKt; or its super classes (declaration of 'androidx.lifecycle.viewmodel.navigation3.ViewModelStoreNavEntryDecoratorKt' appears in /data/app/~~50yEKRCcI6Y7liKbK27RxA==/com.android.developers.androidify-aQPln0gPtO0ak6dP0AbaZw==/base.apk)
                                                                                                    	at com.android.developers.androidify.navigation.MainNavigationKt.MainNavigation(MainNavigation.kt:69)
                                                                                                    	at com.android.developers.androidify.ComposableSingletons$MainActivityKt.lambda__1200648287$lambda$0(MainActivity.kt:62)
                                                                                                    	at com.android.developers.androidify.ComposableSingletons$MainActivityKt$$ExternalSyntheticLambda0.invoke(D8$$SyntheticClass:0)
                                                                                                    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.kt:122)
                                                                                                    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.kt:52)
                                                                                                    	at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:398)
                                                                                                    	at com.android.developers.androidify.MainActivity.onCreate$lambda$0$0(MainActivity.kt:61)
                                                                                                    	at com.android.developers.androidify.MainActivity.$r8$lambda$vy3iED7wUkwWl3H5TIdzJ_lbBS0(Unknown Source:0)
                                                                                                    	at com.android.developers.androidify.MainActivity$$ExternalSyntheticLambda2.invoke(D8$$SyntheticClass:0)
                                                                                                    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.kt:122)
                                                                                                    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.kt:52)
                                                                                                    	at com.android.developers.androidify.theme.ThemeKt.AndroidifyTheme$lambda$0$0$0(Theme.kt:87)
                                                                                                    	at com.android.developers.androidify.theme.ThemeKt.$r8$lambda$luXmuJ3mNBKf6UlOFYulAjU7nBo(Unknown Source:0)
                                                                                                    	at com.android.developers.androidify.theme.ThemeKt$$ExternalSyntheticLambda2.invoke(D8$$SyntheticClass:0)
                                                                                                    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.kt:122)
                                                                                                    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.kt:52)
                                                                                                    	at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:398)
                                                                                                    	at com.android.developers.androidify.theme.ThemeKt.AndroidifyTheme$lambda$0$0(Theme.kt:86)
                                                                                                    	at com.android.developers.androidify.theme.ThemeKt.$r8$lambda$7i0GwH9HRz8lwapzXiZUmIfnffI(Unknown Source:0)
                                                                                                    	at com.android.developers.androidify.theme.ThemeKt$$ExternalSyntheticLambda3.invoke(D8$$SyntheticClass:0)
                                                                                                    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.kt:131)
                                                                                                    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.kt:52)
                                                                                                    	at androidx.compose.animation.SharedTransitionScopeKt$SharedTransitionLayout$1.invoke(SharedTransitionScope.kt:125)
                                                                                                    	at androidx.compose.animation.SharedTransitionScopeKt$SharedTransitionLayout$1.invoke(SharedTransitionScope.kt:122)
                                                                                                    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.kt:143)
                                                                                                    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.kt:52)
                                                                                                    	at androidx.compose.animation.SharedTransitionScopeKt$SharedTransitionScope$1.invoke(SharedTransitionScope.kt:147)
                                                                                                    	at androidx.compose.animation.SharedTransitionScopeKt$SharedTransitionScope$1.invoke(SharedTransitionScope.kt:144)
                                                                                                    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.kt:131)
                                                                                                    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.kt:52)
                                                                                                    	at androidx.compose.ui.layout.LookaheadScopeKt.LookaheadScope(LookaheadScope.kt:61)
                                                                                                    	at androidx.compose.animation.SharedTransitionScopeKt.SharedTransitionScope(SharedTransitionScope.kt:144)
                                                                                                    	at androidx.compose.animation.SharedTransitionScopeKt.SharedTransitionLayout(SharedTransitionScope.kt:122)
2026-01-23 10:10:52.904 19121-19121 AndroidRuntime          com.android.developers.androidify    E  	at com.android.developers.androidify.theme.ThemeKt.AndroidifyTheme$lambda$0(Theme.kt:85) (Fix with AI)

liutikas and others added 2 commits January 22, 2026 15:15
- Upgrade to Gradle 9.3.0
- Upgrade to Hilt 2.59
- Upgrade to Baseline Profile plugin 1.5.0-alpha01
- Upgrade to Google OSS plugin 0.10.10
- Upgrade to Kotlin 2.3.0
- Upgrade to KSP 2.3.4
- Adapt to built-in kotlin in AGP
- Add a missing bom entry in :watchface
- Ensure that we dont use transtive deps in :wear APK copying
- Disable built-in kotlin in :wear:watchface
- Rewrite :wear tasks that add generated APK and XML resources
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @riggaroo, 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!

This pull request performs a significant upgrade of the project's build system, moving to Android Gradle Plugin (AGP) 9.0 and Gradle 9.3.0. It includes a broad sweep of dependency updates across various AndroidX and third-party libraries. The primary motivation for these changes is to fix a critical runtime crash involving nav3 runtime and ViewModelStoreNavEntryDecoratorKt, ensuring the application's stability and compatibility with the latest Android development tools. Additionally, the PR streamlines Kotlin plugin application and refines the watchface build and asset generation processes.

Highlights

  • Android Gradle Plugin (AGP) Upgrade: The project's Android Gradle Plugin has been updated from version 8.13.1 to 9.0.0, bringing the build system up to the latest stable release.
  • Gradle Wrapper Update: The Gradle wrapper has been upgraded from version 8.13 to 9.3.0, along with corresponding updates to the gradlew and gradlew.bat scripts.
  • Extensive Dependency Updates: Numerous AndroidX and other third-party library dependencies, including Compose BOM, Hilt, Kotlin, and various kotlinx serialization libraries, have been updated to their latest versions to ensure compatibility and leverage new features/fixes.
  • Kotlin Plugin Integration Streamlining: Explicit applications of the kotlin.android plugin have been removed from several build scripts, as AGP 9.0 now handles Kotlin integration more seamlessly.
  • Watchface Build Process Refinement: Significant changes were made to the watchface build configurations, including adjustments to sourceSets and a refactor of the ProcessFilesTask to improve watchface APK handling and token generation.
  • Critical Crash Resolution: These updates are specifically aimed at resolving a NoSuchMethodError related to nav3 runtime and ViewModelStoreNavEntryDecoratorKt, which was causing application crashes.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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 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. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

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.

Footnotes

  1. 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.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 effectively updates the project to Android Gradle Plugin 9.0 and refreshes numerous dependencies, which is a significant and important maintenance task. The changes correctly adopt modern AGP practices, such as removing redundant Kotlin plugin applications and leveraging the variant API for managing generated sources, which improves build correctness and performance. The update of the Gradle wrapper scripts to their latest versions also brings welcome improvements in robustness and security. I've added one suggestion in wear/build.gradle.kts to make a part of the custom build logic more robust.

@TaskAction
fun taskAction() {
val apkFile = apkDirectory.asFile.get().resolve("default_watchface.apk")
val sourceApkFile = apkFileCollection.files.single().listFiles().single { it.extension == "apk" }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The current implementation to find the source APK file is a bit brittle. listFiles() can return null if the directory does not exist or an I/O error occurs, which would lead to a NullPointerException. It's safer to handle this potential null case to prevent the build from failing with an unhelpful error.

        val sourceApkFile = (apkFileCollection.singleFile.listFiles() ?: emptyArray()).single { it.extension == "apk" }

@riggaroo riggaroo closed this Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants