question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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 issue

I’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:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Chang-Ericcommented, Jul 26, 2021

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.

0reactions
rcfriascommented, Sep 20, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dagger @ContributesAndroidInjector ComponentProcessor ...
ComponentProcessor was unable to process this interface because not all of its dependencies could be resolved. Check for compilation errors or a ...
Read more >
Dagger + Annotation Processor generated file giving build errors
ComponentProcessor was unable to process this class because not all of its dependencies could be resolved. Check for compilation errors or a circular...
Read more >
dagger component processor
Error :(29, 8) error: dagger.internal.codegen.ComponentProcessor was unable to process this interface because not all of its dependencies could be resolved.
Read more >
java/dagger/internal/codegen/ComponentProcessor.java
* distributed under the License is distributed on an "AS IS" BASIS,. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or...
Read more >
Deep dive into Dagger generated code (part 3) - ProAndroidDev
In this blog post, we will convert generated Dagger code from Java to Kotlin to understand how scopes and subcomponents are implemented.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found