Closed adrianaisemberg closed 2 years ago
Hi @adrianaisemberg,
Thanks for reporting this. I was able to reproduce this, and have a fix for the next Dagger release.
In the meantime, there's a couple ways you could work around this in the current release. If you can share the constructor for the view that this is failing on (It'll be a view that uses @AndroidEntryPoint
where the base class has exactly 4 parameters and the first parameter is likely a primitive or an array).
Also, if possible, just to verify that I've actually fixed the same issue that you're facing, it would be helpful if you can try out the HEAD-SNAPSHOT
to see if it's fixed for you.
I have several which derive from this one:
@OptionalInject
abstract class ViewModelView<
TViewModel : ViewViewModel,
TViewBinding : ViewDataBinding>(
@LayoutRes val layoutId: Int,
context: Context,
attrs: AttributeSet?,
defStyleAttr: Int,
) : FrameLayout(context, attrs, defStyleAttr) {
@Inject
lateinit var viewModel: TViewModel
protected val binding: TViewBinding = DataBindingUtil.inflate<TViewBinding>(
context.layoutInflater(),
layoutId,
this,
true
).apply {
lifecycleOwner = activity() as LifecycleOwner
}
Thanks, I think changing layoutId: Int
to layoutId: Integer
should allow you to work around the issue.
Since updating from
2.38.1
to2.41
i'm getting the following build error: