error: [ComponentProcessor:MiscError] dagger.internal.codegen.ComponentProcessor was unable to process this class because not all of its dependencies could be resolved.
See original GitHub issueI’m using apollo for graphql. I added @inject in the MainRepository class. then, I rebuilt the project for the hilt’s stuff and I got this error.
Error log
/home/gowtham/AndroidStudioProjects/RickNMortyCompose/app/build/tmp/kapt3/stubs/debug/com/gowtham/ricknmorty/MainRepository.java:6: error: [ComponentProcessor:MiscError] dagger.internal.codegen.ComponentProcessor was unable to process this class because not all of its dependencies could be resolved. Check for compilation errors or a circular dependency with generated code. public final class MainRepository { ^
MainRepository.class
class MainRepository @Inject constructor(private val apolloClient: ApolloClient) {
suspend fun getAllCharacters(page: Int): Response<GetCharactersQuery.Data> {
return apolloClient.query(GetCharactersQuery(page = Input.optional(page))).await()
}
}
AllCharacters.graphql
query GetCharacters($page: Int) {
characters(page: $page) {
info {
pages, count, next
}
results {
...CharacterDetail
}
}
}
I assume it happens. because of the GetCharactersQuery.Data
which is the generated code by apollo library. is there any way to solve it?
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
Oops I had started a response to this earlier but got distracted. I think that is a reasonable workaround though, assuming
ApiHelperImpl
is going to be the only class that references the generated code, then just not running the Dagger processor over it should help avoid this problem.I am having the same issue and error description, I have 1 LoginActivity and 1 MainActivity, for some reason the inject only works on the first one.