# Disabling android lint check

**URL:** <https://community.sonarsource.com/t/disabling-android-lint-check/92390>\
**Category:** SonarQube Server / Community Build\
**Tags:** gradle, android, coverage\
**Created:** [June 12, 2023, 8:20pm UTC](https://community.sonarsource.com/t/disabling-android-lint-check/92390 "2023-06-12T20:20:20Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jakub\_Mosakowski](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/jakub_mosakowski/32/34888_2.png) [@Jakub\_Mosakowski](https://community.sonarsource.com/u/Jakub_Mosakowski)\
**Post date:** [June 12, 2023, 8:20pm UTC](https://community.sonarsource.com/t/disabling-android-lint-check/92390/1 "2023-06-12T20:20:20Z")

</div>

Hello!

Is it possible to disable the lint results check during the execution of the sonar task? My logs are filled with errors about missing lint results, but I don’t need them, as I’m using sonar only for coverage.

```auto
No issues information will be saved as the report file '/bitrise/src/{{redacted}}/build/reports/lint-results-debug.xml' can't be read.

java.io.FileNotFoundException: /bitrise/src/{{redacted}}/build/reports/lint-results-debug.xml (No such file or directory)

```

I’m using the sonar gradle plugin (v 4.2.1.3168).

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [June 13, 2023, 2:20pm UTC](https://community.sonarsource.com/t/disabling-android-lint-check/92390/2 "2023-06-13T14:20:12Z")

</div>

Hi,

Analysis doesn’t look for lint reports by default. It sounds like your analysis configuration includes parameters for reports that don’t exist. You should take a look at properties with `sonar.*` names.

&nbsp;  
HTH,  
Ann

---

<div class="post-metadata">

**Author:** ![Jakub\_Mosakowski](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/jakub_mosakowski/32/34888_2.png) [@Jakub\_Mosakowski](https://community.sonarsource.com/u/Jakub_Mosakowski)\
**Post date:** [June 13, 2023, 3:28pm UTC](https://community.sonarsource.com/t/disabling-android-lint-check/92390/3 "2023-06-13T15:28:55Z")

</div>

The only sonar properties I’m using are:

```auto
        property("sonar.projectKey", "NAME")
        property("sonar.host.url", "URL")
        property("sonar.token", "TOKEN")
        property("sonar.core.codeCoveragePlugin", "jacoco")
        property(
            "sonar.coverage.jacoco.xmlReportPaths",
            "${project.buildDir}/reports/jacoco/jacocoTestReport/jacocoTestReport.xml"
        )
        property(
            "sonar.coverage.exclusions",
            coverageExcludeFiles.joinToString(separator = ",")
        )

```

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [June 13, 2023, 3:47pm UTC](https://community.sonarsource.com/t/disabling-android-lint-check/92390/4 "2023-06-13T15:47:36Z")

</div>

Hi,

What plugins is your server running? It looks like this might be the default report path for the [Sonar Android plugin](https://github.com/jvilya/sonar-android-plugin). If none of your projects are passing in these reports, your best option is to just remove the plugin. If some are using it and you want to remove the log lines from the other projects’ analyses, I suppose you could try passing in an empty report…?

&nbsp;  
HTH,  
Ann

---

<div class="post-metadata">

**Author:** ![Jakub\_Mosakowski](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/jakub_mosakowski/32/34888_2.png) [@Jakub\_Mosakowski](https://community.sonarsource.com/u/Jakub_Mosakowski)\
**Post date:** [June 15, 2023, 3:05pm UTC](https://community.sonarsource.com/t/disabling-android-lint-check/92390/5 "2023-06-15T15:05:27Z")

</div>

I’m using a docker image from the documentation:  
[https://docs.sonarqube.org/latest/try-out-sonarqube/](https://docs.sonarqube.org/latest/try-out-sonarqube/)

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [June 15, 2023, 3:53pm UTC](https://community.sonarsource.com/t/disabling-android-lint-check/92390/6 "2023-06-15T15:53:55Z")

</div>

Hi,

I’m not sure what to tell you. That really looks like it’s coming from the Sonar Android plugin. As I said, while you _can_ import linter reports into your analysis, we don’t look for them by default. On the other hand, it’s fairly common for plugins to look for their reports by default.

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![Jakub\_Mosakowski](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/jakub_mosakowski/32/34888_2.png) [@Jakub\_Mosakowski](https://community.sonarsource.com/u/Jakub_Mosakowski)\
**Post date:** [June 15, 2023, 4:34pm UTC](https://community.sonarsource.com/t/disabling-android-lint-check/92390/7 "2023-06-15T16:34:14Z")

</div>

I can provide a sample repo where the same issue occurs:

> **[GitHub - JakubMosakowski/sonarissues: Sonar + JaCoCo playground](https://github.com/JakubMosakowski/sonarissues)**
>
> Sonar + JaCoCo playground. Contribute to JakubMosakowski/sonarissues development by creating an account on GitHub.

on sonarqube instance from: [https://docs.sonarqube.org/latest/try-out-sonarqube/](https://docs.sonarqube.org/latest/try-out-sonarqube/)

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [June 15, 2023, 6:03pm UTC](https://community.sonarsource.com/t/disabling-android-lint-check/92390/8 "2023-06-15T18:03:05Z")

</div>

Hi,

I don’t have a Gradle background. I was unable to get started with this project.

> ```auto
> * Where:
> Build file '/home/anncampbell/testProjects/java/sonarissues/buildSrc/build.gradle.kts' line: 2
> 
> * What went wrong:
> Plugin [id: 'org.gradle.kotlin.kotlin-dsl', version: '2.1.6'] was not found in any of the following sources:
> 
> - Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
> - Plugin Repositories (could not resolve plugin artifact 'org.gradle.kotlin.kotlin-dsl:org.gradle.kotlin.kotlin-dsl.gradle.plugin:2.1.6')
> Searched in the following repositories:
> Gradle Central Plugin Repository
> 
> ```

I tired looking at the project files, but they don’t seem to match up to what’s in the SonarQube docs about [analyzing with Gradle](https://docs.sonarqube.org/latest/analyzing-source-code/scanners/sonarscanner-for-gradle/).

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![Jakub\_Mosakowski](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/jakub_mosakowski/32/34888_2.png) [@Jakub\_Mosakowski](https://community.sonarsource.com/u/Jakub_Mosakowski)\
**Post date:** [June 19, 2023, 10:29am UTC](https://community.sonarsource.com/t/disabling-android-lint-check/92390/9 "2023-06-19T10:29:14Z")

</div>

It is the same repo used at:

> [@Task sonar fails with Gradle plugin 4.2.0.3129](https://community.sonarsource.com/t/task-sonar-fails-with-gradle-plugin-4-2-0-3129/91968/23):
>
> That’s correct. java.lang.UnsupportedOperationException (no error message) only on 4.2. Sample repo:

I didn’t have any trouble running that on different machines. Maybe @Margarita_Nedzelska can help with that, as she seems to be able to run the sample?

---

<div class="post-metadata">

**Author:** ![Jakub\_Mosakowski](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/jakub_mosakowski/32/34888_2.png) [@Jakub\_Mosakowski](https://community.sonarsource.com/u/Jakub_Mosakowski)\
**Post date:** [July 14, 2023, 8:38am UTC](https://community.sonarsource.com/t/disabling-android-lint-check/92390/10 "2023-07-14T08:38:37Z")

</div>

Can I ask once again to verify how I can disable the lint check? I’ve migrated from SonarQube to SonarCloud, and errors are still visible.

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [July 14, 2023, 5:23pm UTC](https://community.sonarsource.com/t/disabling-android-lint-check/92390/11 "2023-07-14T17:23:30Z")

</div>

Hi,

It seems that lint-results-debug.xml has something to do with AndroidLint? We don’t import that (or look for reports) by default. There seems to be a `sonar.androidLint.reportPaths` property specified somewhere.

I suggest you start by adding `sonar.scanner.dumpToFile=[path to file]` to see the full list of analysis parameters passed in to the Scanner. From there you can sort out where on your side this one is coming from.

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![Jakub\_Mosakowski](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/jakub_mosakowski/32/34888_2.png) [@Jakub\_Mosakowski](https://community.sonarsource.com/u/Jakub_Mosakowski)\
**Post date:** [July 17, 2023, 11:27am UTC](https://community.sonarsource.com/t/disabling-android-lint-check/92390/12 "2023-07-17T11:27:51Z")

</div>

It seems that SonarScanner for Gradle plugin is adding those paths.

> <https://github.com/SonarSource/sonar-scanner-gradle/blob/2a927d38d72eb54bcd6d0e742952d25894c75008/src/main/java/org/sonarqube/gradle/AndroidUtils.java#L79>

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [July 17, 2023, 4:07pm UTC](https://community.sonarsource.com/t/disabling-android-lint-check/92390/13 "2023-07-17T16:07:32Z")

</div>

Hi,

Thanks for digging that up. Clearly, I was wrong.

I’m going to flag this for other eyes.

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![Margarita\_Nedzelska](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/margarita_nedzelska/32/47493_2.png) [@Margarita\_Nedzelska](https://community.sonarsource.com/u/Margarita_Nedzelska)\
**Post date:** [July 20, 2023, 3:19pm UTC](https://community.sonarsource.com/t/disabling-android-lint-check/92390/16 "2023-07-20T15:19:00Z")

</div>

Hello @Jakub_Mosakowski,

As far as I can see from the code [here](https://github.com/SonarSource/sonar-scanner-gradle/blob/2a927d38d72eb54bcd6d0e742952d25894c75008/src/main/java/org/sonarqube/gradle/AndroidUtils.java#L216) this property is added only if you have an `AndroidLintTask` and XML report output file is present.

I’m not an Android expert, so I think I need a bit more input here about your case:

Is it that you don’t use AndroidLint and that’s why you don’t have reports, but for some reason, the task is there and the property is automatically set **or** you’re actually using AndroidLint but you execute a `sonar` task before the AndroidLint report is generated and that’s why you get an error.

Looking forward to your answer.

Regards,  
Margarita

---

<div class="post-metadata">

**Author:** ![Jakub\_Mosakowski](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/jakub_mosakowski/32/34888_2.png) [@Jakub\_Mosakowski](https://community.sonarsource.com/u/Jakub_Mosakowski)\
**Post date:** [August 15, 2023, 3:03pm UTC](https://community.sonarsource.com/t/disabling-android-lint-check/92390/18 "2023-08-15T15:03:16Z")

</div>

The problem is that (I think) all Android projects have a `lint` task present, however not everyone is running it.

Running lint is not obligatory, however, the plugin always sets the directory as the lint task is always present (which does not mean it has ever been run).

---

<div class="post-metadata">

**Author:** ![Margarita\_Nedzelska](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/margarita_nedzelska/32/47493_2.png) [@Margarita\_Nedzelska](https://community.sonarsource.com/u/Margarita_Nedzelska)\
**Post date:** [August 25, 2023, 10:01am UTC](https://community.sonarsource.com/t/disabling-android-lint-check/92390/19 "2023-08-25T10:01:34Z")

</div>

Hello @Jakub_Mosakowski,

We’re currently working on improving the Gradle UX for Android projects. At the moment you need to skip this task with `./gradlew sonar -x lint`

Let me know if this doesn’t help.

Regards,  
Margarita

---

<div class="post-metadata">

**Author:** ![mahmoud](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/mahmoud/32/46249_2.png) [@mahmoud](https://community.sonarsource.com/u/mahmoud)\
**Post date:** [September 11, 2023, 3:01pm UTC](https://community.sonarsource.com/t/disabling-android-lint-check/92390/20 "2023-09-11T15:01:41Z")

</div>

I have the same issue.  
I want to remove the lint error when running sonar gradle task.  
That’s clear that it’s handled in the sonar cloud task.

I think the solution is to skip the linting work by default, and enable it if user enable it by applying a sonar config/property.

however, I tried using `./gradlew sonar -x lint` , but that does not work for me.

@Jakub_Mosakowski Did you manage to make it work?

---

<div class="post-metadata">

**Author:** ![arnas](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/arnas/32/49219_2.png) [@arnas](https://community.sonarsource.com/u/arnas)\
**Post date:** [September 14, 2023, 9:28am UTC](https://community.sonarsource.com/t/disabling-android-lint-check/92390/21 "2023-09-14T09:28:18Z")

</div>

Same here. I am getting “Unable to import 1 Android Lint report file(s).” warning and would like to get rid of it. However `./gradlew sonar -x lint` does not work and warning is still present.

---

<div class="post-metadata">

**Author:** ![hieu.nguyen](https://avatars.discourse-cdn.com/v4/letter/h/f9ae1b/32.png) [@hieu.nguyen](https://community.sonarsource.com/u/hieu.nguyen)\
**Post date:** [September 21, 2023, 6:01am UTC](https://community.sonarsource.com/t/disabling-android-lint-check/92390/24 "2023-09-21T06:01:57Z")

</div>

Me too

---

<div class="post-metadata">

**Author:** ![Nelson\_Wijaya](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/nelson_wijaya/32/48285_2.png) [@Nelson\_Wijaya](https://community.sonarsource.com/u/Nelson_Wijaya)\
**Post date:** [November 20, 2023, 11:51am UTC](https://community.sonarsource.com/t/disabling-android-lint-check/92390/25 "2023-11-20T11:51:58Z")

</div>

Hello, is does this issue get escalated to next release ? since i’m getting this problem too and it increases the scan time 300% compared to previous version. It’ll be great if we have the option to turn off lint scans.

[Next page](https://community.sonarsource.com/t/disabling-android-lint-check/92390.md?page=2)
