chore(deps): drop the unused Navigation 2 dependencies - #1420
Merged
Conversation
The app navigates with Navigation 3 behind `CodeNavigator`, but the build still declared Navigation 2: `navigation-fragment-ktx` in `:ui:theme`, `navigation-ui-ktx` in the app module, and the `safeargs` plugin in both the root and app scripts. Nothing consumed any of it. There are no `androidx.navigation` imports in Kotlin sources, no navigation graph XML, no `NavHostFragment`, and no generated `Directions` or `Args` classes. `:ui:theme` uses `FragmentActivity` in `View.kt`, which arrived transitively through `navigation-fragment-ktx`. It still resolves without it, because `androidx-appcompat` is already declared there and depends on `androidx.fragment` as an `api` dependency. `:ui:theme:compileDebugKotlin` and `:apps:flipcash:app:compileDebugKotlin` both pass. This closes #1411, which bumped these artifacts to 2.10.0.
…moval Theme.Code extends Theme.MaterialComponents.DayNight.NoActionBar, but com.google.android.material:material was never declared in the build — it resolved transitively through navigation-ui, whose POM pins it at 1.4.0. Dropping navigation-ui took it off the resource path and broke processDebugResources on the theme parent and its colorPrimaryVariant, colorOnPrimary, colorSecondary, colorSecondaryVariant and colorOnSecondary attributes. Declare it at 1.4.0, the version already resolving, so this stays a build-graph change rather than a theming one. Material 1.5 reworked the color attributes, so a bump is worth doing on its own.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dependabot opened #1411 to bump Navigation from 2.9.8 to 2.10.0. No code uses Navigation 2, so this removes the dependency instead of upgrading it.
Navigation happens through Navigation 3 behind
CodeNavigator. The Navigation 2 artifacts that were still declared:navigation-fragment-ktxin:ui:themenavigation-ui-ktxin the app moduleandroidx.navigation.safeargs.kotlinplugin, in both the root and app build scriptsandroidx-navigationversion and its three catalog aliasesNo Kotlin source imports
androidx.navigation, and there is no navigation graph XML, noNavHostFragment, and no generatedDirectionsorArgsclasses.Two things were reaching the build transitively through these artifacts, and only one of them survives the removal on its own.
FragmentActivity, used byContext.getActivity()inui/theme/src/main/kotlin/com/getcode/ui/utils/View.kt, came in throughnavigation-fragment-ktx. It still resolves, because:ui:themedeclaresandroidx-appcompat, which has anapidependency onandroidx.fragment.com.google.android.material:materialcame in throughnavigation-ui-ktx, which pins it at 1.4.0, and it was never declared anywhere in the build.Theme.Codeinapps/flipcash/app/src/main/res/values/themes.xmlextendsTheme.MaterialComponents.DayNight.NoActionBar, so removingnavigation-ui-ktxfailedprocessDebugResourceson the theme parent and oncolorPrimaryVariant,colorOnPrimary,colorSecondary,colorSecondaryVariantandcolorOnSecondary. The second commit declares it explicitly at 1.4.0, the version already resolving, which keeps this a build-graph change rather than a theming one. Material 1.5 reworked the color attributes, so a bump belongs in its own PR.Closes #1411.