"IllegalArgumentException" in SonarQube Community plugin - android

Recently, when I try to analyze code in Android Studio (Analyze > Inspect Code) I always obtain this error:
11:35:28 IllegalArgumentException: Argument for #NotNull parameter 'sonarServerName' of org/intellij/sonar/persistence/SonarServers.get must not be null
In other projects it works fine. When IllegalArgumentException link is clicked, this screen is shown:
Obviously, I don't want to disable plugin.
Exception text copied here:
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)
Anyone has experienced this issue? Where is the problem and what can I do to resolve it?

You should configure a SonarQube server to use as per the README from the plugin repository:
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.
Click Add, enter the address of your Sonar server and the credentials (if needed) and click OK.

This error can also be thrown when you created the server in the project settings but not in the global settings. You have to select & add the server in the global settings as well.

Related

Android Studio build error on NTFS partition

I'm having problems building apps on Android Studio. Things work fine when the project is on my ext4 partition, but when I created a new one on my NTFS, I encountered this:
Argument for #NotNull parameter 'message' of com/android/tools/idea/gradle/project/sync/GradleSyncState.syncFailed must not be null
java.lang.IllegalArgumentException: Argument for #NotNull parameter 'message' of com/android/tools/idea/gradle/project/sync/GradleSyncState.syncFailed must not be null
at com.android.tools.idea.gradle.project.sync.GradleSyncState.$$$reportNull$$$0(GradleSyncState.java)
at com.android.tools.idea.gradle.project.sync.GradleSyncState.syncFailed(GradleSyncState.java)
at com.android.tools.idea.gradle.project.sync.idea.IdeaSyncPopulateProjectTask.doPopulateProject(IdeaSyncPopulateProjectTask.java:135)
at com.android.tools.idea.gradle.project.sync.idea.IdeaSyncPopulateProjectTask.populate(IdeaSyncPopulateProjectTask.java:97)
at com.android.tools.idea.gradle.project.sync.idea.IdeaSyncPopulateProjectTask.access$000(IdeaSyncPopulateProjectTask.java:39)
at com.android.tools.idea.gradle.project.sync.idea.IdeaSyncPopulateProjectTask$1.run(IdeaSyncPopulateProjectTask.java:86)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:750)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:157)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:580)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:525)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:85)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:144)
at com.intellij.openapi.progress.impl.CoreProgressManager$4.run(CoreProgressManager.java:395)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:305)
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)
The error disappeared when I restarted Android Studio, but after that I still cannot run my app (the project structure in the sidebar is not displayed properly).
I'm using Android Studio 3.2 on Ubuntu 18.04.1.
I figured it out. (By mistake, to be honest...)
Let's say you have an NTFS partition mount at /mnt/ntfs, and your project is at /mnt/ntfs/projects/project.
Your home partition (ext4) is mounted at /home, your home directory is /home/user and you have a symbolic link at /home/user/projects that points to /mnt/ntfs/projects.
The reason I (and hopefully you too) have encountered this error is that when using Android Studio's "Open Project..." option, I provided the symbolic link (/home/user/projects/project). When trying to provide the real path (/mnt/ntfs/projects/project) the gradle sync succeeded.
So to fix this for now, simply provide the real path. However, this should probably be addressed by IntelliJ or the developers of Gradle.

How to debug custom lint detector

I've written a custom lint detector based off this example repo. I'm trying to debug the detector using the tests provided however when I try to run these tests through Android Studio all I get is an error in the bottom right
Empty throwable: Unable to determine gradle tasks to execute
Full error:
Unable to determine gradle tasks to execute
com.intellij.openapi.diagnostic.Logger$EmptyThrowable
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:129)
at com.android.tools.idea.gradle.run.DefaultGradleBuilder.build(DefaultGradleBuilder.java:40)
at com.android.tools.idea.gradle.run.MakeBeforeRunTaskProvider.executeTask(MakeBeforeRunTaskProvider.java:258)
at com.android.tools.idea.gradle.run.MakeBeforeRunTaskProvider.executeTask(MakeBeforeRunTaskProvider.java:86)
at com.intellij.execution.impl.ExecutionManagerImpl$3.run(ExecutionManagerImpl.java:317)
at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:369)
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)
I'm unsure what the issue is as I believe I should be able to debug the detectors like this (see this source)

android instant run alway fail

Error installing cold swap patches: java.net.SocketException: Broken pipe
Error while Installing restart patches
I have tried everything I can, but no luck.
(Error while Installing restart patches when launching android app with Android Studio 2.0)
anyone can help me out?
gradle: 3.2.1
android studio: 2.2.3
Log:
2017-01-06 20:56:00,710 [9781722] WARN - #InstantRun - Failed to push dex files:
java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109)
at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
at java.io.DataOutputStream.write(DataOutputStream.java:107)
at java.io.FilterOutputStream.write(FilterOutputStream.java:97)
at com.android.tools.fd.client.ApplicationPatchUtil.write(ApplicationPatchUtil.java:53)
at com.android.tools.fd.client.ApplicationPatchUtil.write(ApplicationPatchUtil.java:42)
at com.android.tools.fd.client.InstantRunClient$4.communicate(InstantRunClient.java:399)
at com.android.tools.fd.client.InstantRunClient$4.communicate(InstantRunClient.java:393)
at com.android.tools.fd.client.InstantRunClient.talkToAppWithinPortForward(InstantRunClient.java:233)
at com.android.tools.fd.client.InstantRunClient.talkToApp(InstantRunClient.java:202)
at com.android.tools.fd.client.InstantRunClient.pushPatches(InstantRunClient.java:393)
at com.android.tools.fd.client.InstantRunClient.pushPatches(InstantRunClient.java:349)
at com.android.tools.idea.fd.InstantRunManager.pushArtifacts(InstantRunManager.java:187)
at com.android.tools.idea.run.tasks.DexDeployTask.perform(DexDeployTask.java:56)
at com.android.tools.idea.run.LaunchTaskRunner.run(LaunchTaskRunner.java:114)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:563)
at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:142)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:446)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:392)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:127)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$1.run(ProgressManagerImpl.java:126)
at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:369)
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)
Please do following steps
I think the problem is due to instant run feature of Android Studio 2.0.and above This might help
1.Open the Settings or Preferences dialog.
2.Navigate to Build, Execution, Deployment > Instant Run.
Uncheck the box next to Restart activity on code changes

Android Studio Internal IDE Error

I am having an internal IDE error in my android studio. The component properties panel never shows anything. And when I click on a component, there's an error in the event log which says:
IllegalArgumentException: Missing attribute definition for focusable
This is the error details.
Missing attribute definition for focusable
java.lang.IllegalArgumentException: Missing attribute definition for focusable
at com.android.tools.idea.uibuilder.property.NlPropertyItem.<init>(NlPropertyItem.java:88)
at com.android.tools.idea.uibuilder.property.NlPropertyItem.create(NlPropertyItem.java:72)
at com.android.tools.idea.uibuilder.property.NlProperties.getPropertiesWithReadLock(NlProperties.java:111)
at com.android.tools.idea.uibuilder.property.NlProperties.lambda$getProperties$538(NlProperties.java:64)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:966)
at com.android.tools.idea.uibuilder.property.NlProperties.getProperties(NlProperties.java:63)
at com.android.tools.idea.uibuilder.property.NlPropertiesManager.lambda$setSelectedComponents$202(NlPropertiesManager.java:174)
at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:369)
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)
My AS IDE is updated (version 2.2.2), I'm also using Oracle JDK (jdk1.8.0_112).
change the compileSdkVersion and targetSdkVersion from 24 to 23, I think it will help you...
It might be the problem with OpenJDK. Please remove it and install Oracle JDK instead using this post: http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html
Then go to File -> Project Structure and change Java SDK path.
Might it will help you. happy coding.

android studio stuck on new project

I wanted to create a new porject in Android Studio 2.0, so I choosed a name and location for my new project, then I have clicked on the Next button.
after that, in Target Android Devices window, I've choosed a minumum SDK, then clicked on Next button again, but the new project proccess will stuck on a window which is saying Installing Requeted Components and below code is error that shows in Evenet Log : NullPointerException: null
null
java.lang.NullPointerException
at com.android.repository.util.InstallerUtil.resolveCompleteArchiveUrl(InstallerUtil.java:194)
at com.android.repository.impl.installer.BasicInstaller.install(BasicInstaller.java:76)
at com.android.tools.idea.sdk.wizard.legacy.SmwOldApiDirectInstall$InstallTask.run(SmwOldApiDirectInstall.java:203)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:563)
at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:142)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:446)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:392)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:127)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$1.run(ProgressManagerImpl.java:126)
at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:366)
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:744)
at org.jetbrains.ide.PooledThreadExecutor$1$1.run(PooledThreadExecutor.java:55)
How can i pass this error and create a new project now?
*Note: my SDK is full and I have every platform in it
It is not stuck, it will take some time normally 5-7 mins , it also depends upon internet connection, so wait for some time. It will take time only for first launch.
Update: Check the latest log file in
C:\Users\.gradle\daemon\x.y
folder to see what it's downloading.Here is the answer
I have resolve this by installing bundle version.

Categories

Resources