Anyone else do a bunch of updates today (latest al...
# compose
c
Anyone else do a bunch of updates today (latest alpha androidx everything, compose 1.0.1 or 1.1.0-alpha01 and kotlin 1.5.21) and hilt started breaking? Been trying to diagnose this now for a few hours. Throwing in the towel for now and reverting. https://github.com/google/dagger/issues/2800
i
I give up on dagger over javax Injects unresolved.
i
So what does your
MyScreenViewModelFactory
actually override? It sounds like you got the nullability wrong on your
create
method
c
This is what I currently have. I will try to look up the docs if there's an example of this.
Copy code
class MyScreenViewModelFactory(private val client: Client?) : ViewModelProvider.Factory {

    override fun <T : ViewModel?> create(modelClass: Class<T>): T {
        return MyScreenViewModel(client) as T
    }
}
i
Yep,
<T : ViewModel?>
is your problem
😭 1
Remove the
?
c
That was it! Closed the bug. Thanks!
🎉 3