Skip to content

AGP 9.0 requirement is non-obvious and DX is confusing #5098

@TWiStErRob

Description

@TWiStErRob

I got this error on my CI for a minor update of dagger:

* What went wrong:
A problem occurred evaluating root project '...'.
> A problem occurred configuring project ':app'.
   > Failed to notify project evaluation listener.
      > com/android/build/api/artifact/ScopedArtifact$POST_COMPILATION_CLASSES
      > Task with name 'connectedDebugAndroidTest' not found in project ':app'.

it is really confusing, without stack trace I have no clue what's going on, and additionally that connectedDebugAndroidTest problem is very misleading (2nd part is likely project specific though, but clearly attributable to Dagger update).

After adding --stacktrace, from the root cause I can deduce that something has changed in dagger/hilt plugin, but still not clear what until blaming those lines:

Cause 1: java.lang.NoClassDefFoundError: com/android/build/api/artifact/ScopedArtifact$POST_COMPILATION_CLASSES
	at dagger.hilt.android.plugin.HiltGradlePlugin.createHiltCompileOnlyConfiguration(HiltGradlePlugin.kt:256)
	at dagger.hilt.android.plugin.HiltGradlePlugin.configureAggregatingTask$lambda$26(HiltGradlePlugin.kt:204)
	at dagger.hilt.android.plugin.util.VariantsKt$onAllVariants$1.invoke(Variants.kt:55)
	at dagger.hilt.android.plugin.util.VariantsKt$onAllVariants$1.invoke(Variants.kt:54)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions