No android lint issues will be imported on this file

  • ALM used: Bitbucket Cloud
  • CI system used: Bitbucket Cloud
  • Scanner command used: ./gradlew sonar
  • Languages of the repository: kotlin

I have following sonarqube configuration:

property("sonar.junit.reportPaths", "build/test-results/testDebugUnitTest")
        property("sonar.androidLint.reportPaths", "build/reports/lint-results-debug.xml")

When running project I get following errors:

No input file found for /Users/user/Desktop/project/project-android/data/lint-baseline.xml. No android lint issues will be imported on this file.
No input file found for /Users/user/Desktop/project/project-android/ui-common/lint-baseline.xml. No android lint issues will be imported on this file.
No input file found for /Users/user/Desktop/project/project-android/ui-common/lint-baseline.xml. No android lint issues will be imported on this file.

This one is interesting, because I didn’t specify to look for lint-baseline files. Maybe sonar does this by default? What’s also interesting is that these files exist in exact same path, but sonar doesn’t find them. I have all inclusions, exclusions, sources and tests configurations removed from my sonar config.

How to resolve this?

Hey there.

I don’t think that the lint-baseline.xml file is actually being read, but that your androidLint report contains issues raised on the lint-baseline.xml. Can you check the content of your actual report files (lint-results-debug.xml in each module)

They contain issues found by lint. What exactly should I be looking for?

Issues reported on the file lint-baseline.xml itself.

Issue found in data module:

<issue
        id="PackageManagerGetSignatures"
        message="Reading app signatures from `getPackageInfo`: The app signatures could be exploited if not validated properly; see issue explanation for details"
        errorLine1="                    PackageManager.GET_SIGNATURES"
        errorLine2="                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="src/main/kotlin/com/project/data/providers/PackageProviderImpl.kt"
            line="21"
            column="21"/>
    </issue>

Issues in ui-common

   <issue
        id="MissingClass"
        message="Class referenced in the manifest, `com.facebook.FacebookActivity`, was not found in the project or the libraries"
        errorLine1="            android:name=&quot;com.facebook.FacebookActivity&quot;"
        errorLine2="                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="src/main/AndroidManifest.xml"
            line="15"
            column="27"/>
    </issue>