3
votes

I have an gradle android build using android build tools version 1.3.1 and run lint checks on my code. When running the sonar task (provided by the org.sonarqube gradle plugin) the sonar lint plugin (org.sonar.plugins.android.lint.AndroidLintSensor) fails when reading the lint-result file with the following error:

2:35:44.278 [Daemon worker] ERROR o.s.p.a.lint.AndroidLintProcessor - Exception reading /Users/Rene/dev/gradleware/clients/bosch/trials/MyAndroidApplication/app/build/outputs/lint-results-freeRelease-fatal.xml
org.simpleframework.xml.core.ValueRequiredException: Unable to satisfy @org.simpleframework.xml.ElementList(inline=true, entry=, name=, data=false, empty=true, required=true, type=void) on field 'issues' java.util.List org.sonar.plugins.android.lint.AndroidLintProcessor$LintIssues.issues for class org.sonar.plugins.android.lint.AndroidLintProcessor$LintIssues at line 2
    at org.simpleframework.xml.core.Composite.validate(Composite.java:644) ~[simple-xml-2.7.1.jar:na]
    at org.simpleframework.xml.core.Composite.readElements(Composite.java:449) ~[simple-xml-2.7.1.jar:na]
    at org.simpleframework.xml.core.Composite.access$400(Composite.java:59) ~[simple-xml-2.7.1.jar:na]

The lint xml itself looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<issues format="4" by="lint 24.1.2">

</issues>

I'm using sonarqube 5.2 with android sonar plugin 1.1 installed. Is this a known issue? or is there a workaround available?

1
Thanks for reporting this issue, see my answer. - benzonico
thanks. I'll track this issue. - Rene Groeschke
is there a way to get a nightly version of the plugin into my local sonar installation to test the fix? - Rene Groeschke

1 Answers

3
votes

This is indeed a bug in android lint sonar plugin 1.1, see the ticket associated with this issue : https://jira.sonarsource.com/browse/SONARANDRO-38

This should be fixed in version 1.2 of the sonar android lint plugin.