Status Update
Comments
cl...@couchbits.com <cl...@couchbits.com> #2
This happens even if you don't define an action inside the `<composable />`. The pure combination of `<composable />` and plugin `androidx.navigation.safeargs` seems enough.
See attached gradle build log. Used versions of `androidx.navigation.safeargs` and `navigation-fragment-compose` is `2.8.1`.
See attached gradle build log. Used versions of `androidx.navigation.safeargs` and `navigation-fragment-compose` is `2.8.1`.
we...@gmail.com <we...@gmail.com> #3
We are having the same issue with navigation-fragment-compose.
Adding a composable to nav graph leads to compilation error.
Has anyone started looking into this issue yet?
Adding a composable to nav graph leads to compilation error.
Has anyone started looking into this issue yet?
se...@gmail.com <se...@gmail.com> #4
I just had the same issue and it seems to be working if you remove the "\" before the "$". In the above example the name would be "com.example.HomeScreenKt$HomeScreen".
Some other things that I noticed:
1. Make sure the composable function does not have any parameters ex: fun HomeScreen(){ }
2. If you use hilt and you need to inject a viewmodel you will have to use hiltViewModel() from hilt-navigation-compose(https://developer.android.com/jetpack/androidx/releases/hilt ) instead of viewModel() inside the composable function
Some other things that I noticed:
1. Make sure the composable function does not have any parameters ex: fun HomeScreen(){ }
2. If you use hilt and you need to inject a viewmodel you will have to use hiltViewModel() from hilt-navigation-compose(
jb...@google.com <jb...@google.com>
pr...@google.com <pr...@google.com>
aa...@gmail.com <aa...@gmail.com> #5
Affected by the same issue. I can also confirm that removing the \
before the $
fixes the compilation error.
ap...@google.com <ap...@google.com> #6
Project: platform/frameworks/support
Branch: androidx-main
Author: Jeremy Woods <
Link:
Provide safe args classes for composables in safe args
Expand for full commit details
Provide safe args classes for composables in safe args
Adding support for Directions and Args classes in Navigation safe args.
RelNote: "Navigation Safe Args now provides support for composable
destinations."
Test: added tests
Bug: 362791955
Change-Id: I353205e72fe2896cae7ca1f563bfe58798e59578
Files:
- M
navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/models/Destination.kt
- M
navigation/navigation-safe-args-generator/src/test/kotlin/androidx/navigation/safe/args/generator/NavGeneratorTest.kt
- M
navigation/navigation-safe-args-generator/src/test/kotlin/androidx/navigation/safe/args/generator/NavParserTest.kt
- M
navigation/navigation-safe-args-generator/src/test/test-data/naive_test.xml
Hash: 44dc2bd5961dfd6665e06246c9b38ec916ea9364
Date: Wed Feb 05 19:24:28 2025
jb...@google.com <jb...@google.com> #7
This has been fixed internally and will be available in the Navigation 2.9.0-alpha06
and 2.8.7
releases.
pr...@google.com <pr...@google.com> #8
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.navigation:navigation-safe-args-generator:2.9.0-alpha06
androidx.navigation:navigation-safe-args-generator:2.8.7
Description
Component used: Navigation (
androidx.navigation:navigation-fragment-compose
)Version used: 2.8.0-rc01
Devices/Android versions reproduced on: N/A (build issue)
As soon as I add an
action
to acomposable
destination like so:My project build fails on the
:app:generateSafeArgs
task with the following error: