Context
I am migrating my multi-modules Android application project from AGP 7.4.2, Gradle 7.6.4, JDK 11 to AGP 8.0.2, Gradle 8.0.2, JDK 17. See this commit.
Before (AGP 7.4.2, Gradle 7.6.4, JDK 11)
Before the referenced commit, I successfully executed tests via:
./gradlew testDebug :engelsystem:test testCcc37C3DebugUnitTest assembleCcc37C3Debug`
After (AGP 8.0.2, Gradle 8.0.2, JDK 17)
Once I checkout the referenced commit and execute the same command it raises the following exception:
org.gradle.execution.TaskSelectionException: Task 'testDebug' is ambiguous in root project 'EventFahrplan' and
its subprojects. Candidates are: 'testCcc37c3DebugUnitTest', 'testCccamp2023DebugUnitTest', 'testDebugUnitTest', 'testJev2022DebugUnitTest'.
at org.gradle.execution.DefaultTaskSelector.getSelection(DefaultTaskSelector.java:86)
at org.gradle.execution.selection.DefaultBuildTaskSelector.resolveTaskName(DefaultBuildTaskSelector.java:98)
at org.gradle.execution.commandline.CommandLineTaskParser.parseTasks(CommandLineTaskParser.java:49)
...
Mitigation
The error can be mitigated by executing the following command instead:
./gradlew testDebugUnitTest :engelsystem:test testCcc37C3DebugUnitTest assembleCcc37C3Debug
Question 
Why does testDebug
fail all the sudden?
I cannot find any hint in the release notes.