Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Hilt implemented twice #1569

Open
3 tasks done
Jaehwa-Noh opened this issue Aug 13, 2024 · 0 comments · May be fixed by #1570
Open
3 tasks done

[Bug]: Hilt implemented twice #1569

Jaehwa-Noh opened this issue Aug 13, 2024 · 0 comments · May be fixed by #1570
Labels
bug Something isn't working

Comments

@Jaehwa-Noh
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Is there a StackOverflow question about this issue?

  • I have searched StackOverflow

What happened?

class HiltConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
pluginManager.apply("com.google.devtools.ksp")
dependencies {
add("ksp", libs.findLibrary("hilt.compiler").get())
add("implementation", libs.findLibrary("hilt.core").get())
}
/** Add support for Android modules, based on [AndroidBasePlugin] */
pluginManager.withPlugin("com.android.base") {
pluginManager.apply("dagger.hilt.android.plugin")
dependencies {
add("implementation", libs.findLibrary("hilt.android").get())
}
}
}
}
}

class HiltConventionPlugin : Plugin<Project> {
    override fun apply(target: Project) {
        with(target) {
            pluginManager.apply("com.google.devtools.ksp")
            dependencies {
                add("ksp", libs.findLibrary("hilt.compiler").get())
                add("implementation", libs.findLibrary("hilt.core").get())
            }

            /** Add support for Android modules, based on [AndroidBasePlugin] */
            pluginManager.withPlugin("com.android.base") {
                pluginManager.apply("dagger.hilt.android.plugin")
                dependencies {
                    add("implementation", libs.findLibrary("hilt.android").get())
                }
            }
        }
    }
}

When the one module was applied plugin com.android.base, It would be implementation hilt.core and hilt.android.
But the hilt.android contains hilt.core, so that hilt.core will be a redundant implementation.

Relevant logcat output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Jaehwa-Noh Jaehwa-Noh added the bug Something isn't working label Aug 13, 2024
@Jaehwa-Noh Jaehwa-Noh linked a pull request Aug 13, 2024 that will close this issue
@lcpp6 lcpp6 mentioned this issue Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant