android / android/architecture-samples
gradlew test fails with "Unresolved reference: HiltTestActivity"
- Dominant language
- Kotlin
- Stars
- 45.8k
- Forks
- 11.9k
- PR merge metrics
- No merged PRs in 30d
Description
Relevant log output:
```
> Task :app:compileReleaseUnitTestKotlin FAILED
e: /Users/donturner/Code/workspace-android/architecture-samples/app/src/sharedTest/java/com/example/android/architecture/blueprints/todoapp/addedittask/AddEditTaskScreenTest.kt: (32, 60): Unresolved reference: HiltTestActivity
```
This is because `HiltTestActivity` is defined only for the `debug` source set so is not available for `release` builds.
Contributor guide
Research direction
Start with the Gradle test failure and app/src/sharedTest/java/com/example/android/architecture/blueprints/todoapp/addedittask/AddEditTaskScreenTest.kt, then inspect where HiltTestActivity is defined and how the debug and release source sets are assembled. The work is done when gradlew test compiles the release unit tests without the unresolved-reference error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100