当前位置: 首页 > 知识库问答 >
问题:

SonarQube与android项目集成的问题

仲孙铭
2023-03-14

我正试图将sonarqube集成到我的android项目中。下面是我的根构造。gradle

我试图遵循这里提到的内容--http://docs.SonarQube.org/display/scan/analysy+with+SonarQube+scanner+for+gradle,并用Lint和SonarQube分析Android项目

    plugins {
    id "org.sonarqube" version "2.2"
}

sonarqube {
    properties {
        property "sonar.profile", "Android Lint"
        property "sonar.sources", "./src/main/java"
        property 'sonar.host.url', '<sonar_qube_server_url>'
        property 'sonar.sourceEncoding', 'UTF-8'
        property 'sonar.import_unknown_files', true
        property 'sonar.android.lint.report', 'build/outputs/lint-results.xml'
    }
}
./gradlew sonarqube
Observed package id 'add-ons;addon-google_apis-google-19' in inconsistent location '/Users/<username>/Library/Android/sdk/add-ons/addon-google_apis-google-19-1' (Expected '/Users/<username>/Library/Android/sdk/add-ons/addon-google_apis-google-19')
Observed package id 'add-ons;addon-google_apis-google-19' in inconsistent location '/Users/<username>/Library/Android/sdk/add-ons/addon-google_apis-google-19-1' (Expected '/Users/<username>/Library/Android/sdk/add-ons/addon-google_apis-google-19')
Observed package id 'add-ons;addon-google_apis-google-19' in inconsistent location '/Users/<username>/Library/Android/sdk/add-ons/addon-google_apis-google-19-1' (Expected '/Users/<username>/Library/Android/sdk/add-ons/addon-google_apis-google-19')
Observed package id 'add-ons;addon-google_apis-google-19' in inconsistent location '/Users/<username>/Library/Android/sdk/add-ons/addon-google_apis-google-19-1' (Expected '/Users/<username>/Library/Android/sdk/add-ons/addon-google_apis-google-19')
Incremental java compilation is an incubating feature.

FAILURE: Build failed with an exception.

* What went wrong:
com/android/build/gradle/api/BaseVariant
> com.android.build.gradle.api.BaseVariant

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

共有1个答案

葛炜
2023-03-14

能够弄清楚这个问题。我正在为gradle使用2.2V的sonarqube插件,这与我的gradle版本不兼容。将插件版本改为2.0V&开始解决任何问题。

 类似资料: