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.

Hilt, androidTest build failed in versions >= 2.40.4

See original GitHub issue

Last working version is 2.40.3. Every test class generates next error:

> Task :app:hiltJavaCompileDevDebugAndroidTest
app/build/generated/hilt/component_sources/devDebugAndroidTest/.../..._TestComponentDataSupplier.java:8: error: cannot find symbol
import dagger.hilt.android.internal.testing.root.DaggerDefault_HiltComponents_SingletonC;
                                                ^
  symbol:   class DaggerDefault_HiltComponents_SingletonC
  location: package dagger.hilt.android.internal.testing.root

With final error:

error: dagger.internal.codegen.ComponentProcessor was unable to process 'dagger.hilt.android.internal.testing.root.Default_HiltComponents.SingletonC' because not all of its dependencies could be resolved. Check for compilation errors or a circular dependency with generated code.

I don’t see any errors which may hint why Default_HiltComponents.SingletonC is not generated.

Any more information I can provide?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:12

github_iconTop GitHub Comments

7reactions
PolinaDurdevacommented, Jul 12, 2022

After updating to the 2.42 version the initial problem happens again.

2reactions
bcorsocommented, Jan 13, 2022

@mik9 thanks for the error report!

I don’t see any errors which may hint why Default_HiltComponents.SingletonC is not generated.

That error message indicates that Default_HiltComponents.SingletonC is already generated but it cannot be processed because one of its dependencies cannot be found on the classpath. I’m currently working on improving the error message to include more information about which exact type could not be found.

I should hopefully have something by next week that you can try out using the HEAD-SNAPSHOT artifacts. The better error message should allow you to pinpoint what’s going wrong. I’ll update this thread once that’s ready.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error in gradle when implement hilt library in android
This is weird issue even i faced, i solved it by making sure these 2 dependencies version in Build.gradle ...
Read more >
Hilt testing guide | Android Developers
This makes Hilt work for all of the instrumented tests in your project. Perform the following steps: Create a custom class that extends...
Read more >
Gradle Build Setup - Dagger
When the Android Gradle plugin (AGP) version used in the project is less than 4.2, then the Hilt Gradle plugin by default, will...
Read more >
com.google.dagger » hilt-android-testing » 2.40.4
Date and Time Utilities · Top Categories · Home » com.google.dagger » hilt-android-testing » 2.40.4 ... Note: There is a new version for...
Read more >
Hilt makes testing easier on Android - YouTube
The best android courses in the world: https://codingwithmitch.com/Watch the HILT course here (FREE): ...
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