Fixed
Status Update
Comments
il...@google.com <il...@google.com> #2
I see that this issue was assigned. I can create Pull Request if need.
il...@google.com <il...@google.com> #5
I think your PR also fixes our problem: we have links like
.../search/
.../search?documentId=123
.../search?folder=123
And each should be redirected to different navigation destinations. Currently they all redirect to one page, and sometimes crash.
Description
Version used: I can reproduce it in a different versions.
Devices/Android versions reproduced on: Pixel XL
This error is logged in NavDestination.onInflate() when NavHostFragment inflates nav graph. The call stack is:
NavHostFragment.onCreate()
NavController.setGraph()
NavInflater.inflate(int graphResId)
NavInflater.inflate(Resources res, XmlResourceParser parser, AttributeSet attrs, int graphResId)
NavDestination.onInflate()
In NavDestination.onInflate(), if <navigation> doesn’t have an id, we will set mId to 0. Then we pass mId to getDisplayName(). Because mId is 0 now, it will throw a Resources.NotFoundException and log error “Invalid ID 0x00000000”.