问题描述
直到我更新了android studio为止,Android声纳库才工作.现在出现错误
Android sonarqube worked until I updating android studio. Now it gives an error
FAILURE: Build failed with an exception.
* What went wrong:
com.android.build.gradle.api.ApkVariant.getCompileLibraries()Ljava/util/Collection;
我认为发生这种情况是因为gradle依赖项语法从"编译"更改为"实现",就像下面的最新android版本一样.
I think this happens because gradle dependency syntax changed from 'compile' to 'implementation' like below in newest android version.
来自
dependencies {
compile ........
compile ........
}
到
dependencies {
implementation ........
implementation ........
}
任何人都可以帮助我为新的Android版本配置sonarqube
Can anyone please help me to configure sonarqube for new android version
推荐答案
阅读答案的最后部分以获取最新更新
原始答案
我已经进行了一些研究:
I've performed some researches:
-
此处,您可以找到SonarQube内部跟踪的问题
here you canfind the issue tracked internally by SonarQube
此处您可以找到SonarQube开发人员向Google提出的问题有关API更改的信息.正如Google工程师所说,此更改是有意的,并且已经存在替代API. SonarQube表示,他们将不支持android plugin 3.0.0,直到最终版本或至少RC版本
here youcan find the issue opened by a SonarQube developer asking Googleabout the API change. As stated by Google engineers this change is intended and an alternative API already exists. SonarQube stated they won't support android plugin 3.0.0 until the final release or at least RC version
结果:
更新-2017年11月6日
buildscript {
repositories {
google()
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.6.1"
}
}
allprojects {
repositories {
google()
jcenter()
}
}
apply plugin: "org.sonarqube"
发布页面中的更多信息这里
More info in the release page HERE
这篇关于SonarQube-Android不适用于Gradle 3.0.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!