Fixed
Status Update
Comments
lc...@gmail.com <lc...@gmail.com> #2
Hi. Thanks for reporting this. Fixed in alpha-04
jo...@gmail.com <jo...@gmail.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit e782987543a9f8ccd485e970ddc74564b24378db
Author: Vighnesh Raut <vighnesh.raut13@gmail.com>
Date: Mon Jan 02 15:27:40 2023
fix: tab row crashes when only 1 tab is added
Bug: b/264018028
Test: Added unit test
Change-Id: I6381dbac304fc1d69d3708c6655f8b595668e93f
M tv/tv-material/src/androidTest/java/androidx/tv/material/TabRowTest.kt
M tv/tv-material/src/main/java/androidx/tv/material/TabRow.kt
https://android-review.googlesource.com/2373449
Branch: androidx-main
commit e782987543a9f8ccd485e970ddc74564b24378db
Author: Vighnesh Raut <vighnesh.raut13@gmail.com>
Date: Mon Jan 02 15:27:40 2023
fix: tab row crashes when only 1 tab is added
Bug:
Test: Added unit test
Change-Id: I6381dbac304fc1d69d3708c6655f8b595668e93f
M tv/tv-material/src/androidTest/java/androidx/tv/material/TabRowTest.kt
M tv/tv-material/src/main/java/androidx/tv/material/TabRow.kt
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #4
deleted
jb...@google.com <jb...@google.com> #5
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.tv:tv-material:1.0.0-alpha04
ec...@gmail.com <ec...@gmail.com> #6
I'm still seeing this issue on version 2.5.2
jb...@google.com <jb...@google.com> #7
Please file a new issue with a minimal project reproducing what you are seeing.
Description
Component used: Navigation
Version used: 2.4.0-alpha09
Devices/Android versions reproduced on: Not device dependent, code generation issue
Safeargs plugin on 2.4.0-alpha09 since it implemented this behaviour change below
When generating arguments, Safe Args now puts parameters without default values before those with default values. (I89709, b/198493585)
This bahvious change seesms to cause the side effect of compilation time errors in the genrated argument files. As far as I know this affects both kotlin and java generated files.
e.g.
XML navgraph destination (
NavCompFingerPrintAuthDialogFragment
)As you can see the arguments with no default values are not defined first.
this will generate the argument data object shown below with the behavios change which puts the arguments with no default values first in the constructor.
Now the problem is that in the
NavCompFingerPrintAuthDialogFragmentArgs.fromBundle(bundle: Bundle): NavCompFingerPrintAuthDialogFragmentArgs
companion function does not use named arguments when creating aNavCompFingerPrintAuthDialogFragmentArgs
from a bundle. And it uses the arguments in the order that it was defined in the navgraph and not in the order that theNavCompFingerPrintAuthDialogFragmentArgs
data object expects in its constructor. The same issue also apples for the companion functionfromSavedStateHandle(savedStateHandle: SavedStateHandle):NavCompFingerPrintAuthDialogFragmentArgs
but compilation will fail at the earliest point so it was not reported in the error. But from what i can see in the genrated code, its will have the same problem too.One solution is to just use named arguments for kotlin generated files, but it does not solve the issue for java generated files. So perhaps putting the arguments in the order of the
behavior change
mention above shld solve the issue.