Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Thank you for your feedback. Team may reach out for more feedback in reproducing or triaging this issue.
jb...@google.com <jb...@google.com> #3
Could you try AGP 3.3.0-rc01 or 3.4.0-alpha06 and see if it fixes the issue?
If not, could you provide a sample project (as the error message above is not enough for us to debug the issue)?
If not, could you provide a sample project (as the error message above is not enough for us to debug the issue)?
Description
When adding the stateless aosp/1859226 it used the
SavedStateViewModelFactory
constructor inAndroidViewModelFactory
under the hood, which meant that when using the statelessSavedStateViewModelFactory
and creating aViewModel
viaCreationExtras
, it required anApplication
to be set.Having an
Application
should not be a requirement for creating aViewModel
using theSavedStateViewModelFactory
or theAndroidViewModelFactory
. We should fix the behavior of theAndroidViewModelFactory
to rely on theNewInstanceFactory
when no application is available, just like theSavedStateViewModelFactory
used to.