rkeazor

    rkeazor

    1 year ago
    Hey DaggerHeads, im running into a issue where hilt doesn't allow BaseClasses with default values. For Example
    abstract class BaseActivity(layouId: Int = 0) // Hilt complains that default value of 0 is not allowed
    FunkyMuse

    FunkyMuse

    1 year ago
    This isn't a Hilt issue, unless you're injecting that BaseActivity class which is a bad idea
    rkeazor

    rkeazor

    1 year ago
    @FunkyMuse this is the error message
    The base class, 'com.example.android.dagger.registration.BaseActivity', of the @AndroidEntryPoint, 'com.example.android.dagger.login.LoginActivity', 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.
      [Hilt] Processing did not complete. See e
    FunkyMuse

    FunkyMuse

    1 year ago
    Welp the solution is offered to you by Hilt and also having a default parameter for a base class is a bad idea nevertheless
    rkeazor

    rkeazor

    1 year ago
    why you say that @FunkyMuse
    why is it a bad idea @FunkyMuse?