SonarCloud Analysis Issue with Java 17 Upgrade

We recently upgraded our Java version from 11 to 17, and since then, we have been facing the following error during the SonarCloud analysis:

Error: Resource not found: com..view.fragments.kittes_screen.CreateKittiesFragmentTest under the directory /home/runner/work//***/app while reading test reports. Please, make sure your “sonar.junit.reportPaths” property is configured properly.

Key Information:

  • Java Version: 17
  • SonarCloud Analysis Command (GitHub Actions):
    ./gradlew clean testDebugUnitTest sonar -Dsonar.projectKey=${{ secrets.PROJECTKEY }} -Dsonar.organization=${{ secrets.ORG }}${{ secrets.HOSTURL }} -Dsonar.projectName=${{ secrets.PROJECTNAME }} -Dsonar.token=${{ secrets.SONAR_TOKEN }} -Dsonar.coverage.jacoco.xmlReportPaths=${{ secrets.XMLREPORTPATH }}${{ secrets.COVERAGEPLUGIN }} -Dsonar.junit.reportsPath=${{ secrets.JUNITREPORTPATH }}${{ secrets.LINTREPORT }} -Dsonar.sources=${{ secrets.SONARSRC }}

Additional Context:

  • The issue seems to be related to the Java 17 upgrade, as it worked well with Java 11.
  • We have verified the correctness of the SonarCloud configuration in our GitHub Actions workflow.

Hey there.

Have you made sure your tests are still running properly after the upgrade, and generating a report in the same place as before?