android - SonarQube 社区插件中的 "IllegalArgumentException"

标签 android android-studio sonarqube sonar-runner

最近,当我尝试在 Android Studio 中分析代码(分析 > 检查代码)时,我总是收到此错误:

11:35:28 IllegalArgumentException: Argument for @NotNull parameter 'sonarServerName' of org/intellij/sonar/persistence/SonarServers.get must not be null

在其他项目中它运行良好。单击 IllegalArgumentException 链接时,将显示以下屏幕:

IDE Fatal Error: Exception in SonarQube Community plugin

显然,我不想禁用插件。

异常文本复制到此处:

Argument for @NotNull parameter 'sonarServerName' of org/intellij/sonar/persistence/SonarServers.get must not be null
java.lang.IllegalArgumentException: Argument for @NotNull parameter 'sonarServerName' of org/intellij/sonar/persistence/SonarServers.get must not be null
    at org.intellij.sonar.persistence.SonarServers.get(SonarServers.java)
    at org.intellij.sonar.analysis.DownloadIssuesTask.from(DownloadIssuesTask.java:53)
    at org.intellij.sonar.analysis.SonarQubeInspectionContext.performPreRunActivities(SonarQubeInspectionContext.java:143)
    at com.intellij.codeInspection.ex.GlobalInspectionContextBase.initializeTools(GlobalInspectionContextBase.java:340)
    at com.intellij.codeInspection.ex.GlobalInspectionContextImpl.runTools(GlobalInspectionContextImpl.java:339)
    at com.intellij.codeInspection.ex.GlobalInspectionContextBase$6.run(GlobalInspectionContextBase.java:283)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:452)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:449)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:402)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
    at com.intellij.codeInspection.ex.GlobalInspectionContextBase.performInspectionsWithProgress(GlobalInspectionContextBase.java:280)
    at com.intellij.codeInspection.ex.GlobalInspectionContextBase$4.run(GlobalInspectionContextBase.java:241)
    at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:563)
    at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:152)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:452)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:402)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:137)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$1.run(ProgressManagerImpl.java:126)
    at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:405)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    at org.jetbrains.ide.PooledThreadExecutor$1$1.run(PooledThreadExecutor.java:56)

有人遇到过这个问题吗?问题出在哪里,我该如何解决?

最佳答案

您应该配置 SonarQube 服务器以按照 README 使用来自插件存储库:

After the installation, you first of all need to configure the connection to your Sonar server. This is done per project and/ or module. You can use a remote server or a local one on your machine.

In your IDE go to Preferences -> SonarQube.

In your IDE go to Preferences -> SonarQube

Click Add, enter the address of your Sonar server and the credentials (if needed) and click OK.

enter image description here

关于android - SonarQube 社区插件中的 "IllegalArgumentException",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30234240/

相关文章:

sonarqube - Sonar 发射错误

android - Firebase 电子邮件验证链接中的深层链接不起作用

android - 找不到 R.Id。在 fragment 中

android - 在 Android Studio 中将 png 图像转换为 9 补丁

android - Nexus 10 模拟器上的不同屏幕尺寸和分辨率

ruby-on-rails - 使用 SonarQube 扫描 Ruby on Rails 项目

java - Google Play 服务 9.2.0 (Admob) 的 NoClassDefFoundError

java - 如何在android中安全地停止线程?

android-studio - 如何在flutter中禁用自动TODO注释?

java - 在 Sonar 中修改规则