Skip to content

fix(di): add @JvmStatic to AppModule @Provides methods for sideload flavor build - #525

Open
Himanth-reddy wants to merge 1 commit into
mainfrom
fix/hilt-appmodule-jvmstatic
Open

fix(di): add @JvmStatic to AppModule @Provides methods for sideload flavor build#525
Himanth-reddy wants to merge 1 commit into
mainfrom
fix/hilt-appmodule-jvmstatic

Conversation

@Himanth-reddy

Copy link
Copy Markdown
Collaborator

Summary

Adds @JvmStatic to @provides methods inside AppModule object.

Problem

When compiling variant-specific builds like sideloadDebug, Dagger Hilt fails with missing binding errors because Kotlin object methods without @JvmStatic generate instance methods on AppModule.INSTANCE rather than static providers.

Solution

Adding @JvmStatic to all @provides functions in AppModule ensures static provider methods are emitted into Java bytecode, allowing Hilt Dagger annotation processing to resolve all bindings across all build variants.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant