Hi all,
We’re currently struggling with setting up the SonarCloud project for Android (Java/Kotlin combined).
When adding the project, upon extra configuration we’ve selected Github Action.
It fails after running 8-9 minutes in the Build and analyze job in the (default) Github workflow yaml:
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew build sonarqube --info
It fails with the following:
Lint found 36 errors, 197 warnings. First failure:
/home/runner/work/xxxx-xxxx.java:339: Error: xxxxx
~~~~~~~~~~~~~~~~
The full lint text report is located at:
/home/runner/work/xxxx/intermediates/lint_intermediate_text_report/debug/lint-results-debug.txt
:app:lintDebug (Thread[Execution worker for ':',5,main]) completed. Took 0.003 secs.
Android Lint: Disposing Uast application environment in lint classloader [30.2.2]
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:lintDebug'.
> Lint found errors in the project; aborting build.
The project compiles and runs fine locally (APK with current code also running fine in the PlayStore), but gives this error in the Github Action build, preventing the analysis to be shown in SonarCloud.
What we would expect is the build step to ignore these errors and mark them so they are shown in SonarCloud which we can then use to go through all errors and fix them (as in our PHP & iOS projects).
How can we achieve this, or should we not achieve this at all but have a go at it in a different way (first solving all 36 errors as shown by LintDebug in Github Action log is not desired).
Thanks for your reactions!