https://kotlinlang.org logo
#compose
Title
# compose
g

georgiy.shur

09/10/2021, 3:48 PM
I’m having problems using Hilt injection into custom Compose view. I’m using this as an entry point.
Copy code
@AndroidEntryPoint
class CustomComposeView(context: Context) 
    : AbstractComposeView(context, null, 0)
But I’m getting an error:
Copy code
The base class, 'androidx.compose.ui.platform.AbstractComposeView', of the @AndroidEntryPoint, 'com.example.CustomComposeView', contains a constructor with default parameters. This is currently not supported by the Gradle plugin. Either specify the base class as described at <https://dagger.dev/hilt/gradle-setup#why-use-the-plugin> or remove the default value declaration.
I cannot modify the base class because I don’t own it and I don’t understand where should I specify the base class. Any ideas?
s

sherry.yuan

03/14/2022, 6:55 PM
👋 I’m running into the same error on a custom compose view, did you ever find a fix for this?
61 Views