Sync Gradle projects with workspace failed: Execution failed for task - java

I am trying to import a fresh project into my eclipse photon workspace with JAVA 8 and Gradle 4.8.1. I see the following exception. I am not sure why it is trying to build tests while importing the project itself.
org.gradle.tooling.BuildException: Could not run build action using Gradle distribution 'https://services.gradle.org/distributions/gradle-4.8.1-all.zip'.
at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:51)
at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:29)
...
Caused by: org.gradle.internal.exceptions.LocationAwareException: Execution failed for task ':buildSrc:test'.
at org.gradle.initialization.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:74)
at org.gradle.initialization.MultipleBuildFailuresExceptionAnalyser.transform(MultipleBuildFailuresExceptionAnalyser.java:47)
...
Caused by: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':buildSrc:test'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:77)
...
... 3 more
Caused by: org.gradle.api.GradleException: There were failing tests. See the report at: file:///C:/sources/elasticsearch-master/buildSrc/build-bootstrap/reports/tests/test/index.html
at org.gradle.api.tasks.testing.AbstractTestTask.handleTestFailures(AbstractTestTask.java:612)
at org.gradle.api.tasks.testing.AbstractTestTask.executeTests(AbstractTestTask.java:484)
at org.gradle.api.tasks.testing.Test.executeTests(Test.java:603)
...
... 30 more
UPDATE
Both didn't work however am using 4.4.1 version now :
"Loading Gradle project preview faileddue to error in the referenced gradle build"
org.gradle.tooling.BuildException: Could not fetch model of type 'GradleBuild' using Gradle installation 'C:\gradle'.
at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:51)
at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:29)
at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:41)
...
Caused by: org.gradle.internal.exceptions.LocationAwareException: Execution failed for task ':buildSrc:compileGroovy'.
at org.gradle.initialization.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:74)
at org.gradle.initialization.MultipleBuildFailuresExceptionAnalyser.transform(MultipleBuildFailuresExceptionAnalyser.java:47)
...
Caused by: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':buildSrc:compileGroovy'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
...
... 95 more
Caused by: org.gradle.api.internal.tasks.compile.CompilationFailedException: Compilation failed; see the compiler error output for details.
at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:180)
at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:56)
...
... 3 more

Related

Execution failed for task ':app:mergeExtDexDebug'

I keep getting this error while trying to build a debug apk for my android app. The app builds and runs on a native device or emulator.
Execution failed for task ':app:mergeExtDexDebug'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Failed to transform fastutil-8.3.0.jar (it.unimi.dsi:fastutil:8.3.0) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-is-debuggable=true, dexing-min-sdk=23, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Execution failed for DexingWithClasspathTransform: /Users/kingsleyokoye/.gradle/caches/transforms-3/c6c5e6c867a7a9428e59b7cabb0a5c1a/transformed/jetified-fastutil-8.3.0.jar.
> Error while dexing.
and If i run with stacktrace, I get a more detailed error message.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Failed to transform fastutil-8.3.0.jar (it.unimi.dsi:fastutil:8.3.0) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-is-debuggable=true, dexing-min-sdk=23, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Execution failed for DexingWithClasspathTransform: /Users/kingsleyokoye/.gradle/caches/transforms-3/c6c5e6c867a7a9428e59b7cabb0a5c1a/transformed/jetified-fastutil-8.3.0.jar.
> Error while dexing.
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:mergeExtDexDebug'.
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:38)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:74)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:408)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:395)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:388)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:374)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
org.gradle.api.internal.file.DefaultFileCollectionFactory$ResolvingFileCollection.visitChildren(DefaultFileCollectionFactory.java:333)
at org.gradle.api.internal.file.CompositeFileCollection.visitContents(CompositeFileCollection.java:119)
at org.gradle.api.internal.file.AbstractFileCollection.visitStructure(AbstractFileCollection.java:330)
at org.gradle.api.internal.file.CompositeFileCollection.lambda$visitContents$0(CompositeFileCollection.java:119)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
Caused by: org.gradle.api.internal.artifacts.transform.TransformException: Failed to transform fastutil-8.3.0.jar (it.unimi.dsi:fastutil:8.3.0) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-is-debuggable=true, dexing-min-sdk=23, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
at org.gradle.api.internal.artifacts.transform.TransformingAsyncArtifactListener$TransformedArtifact.lambda$visit$2(TransformingAsyncArtifactListener.java:221)
at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:268)
at org.gradle.api.internal.artifacts.transform.TransformingAsyncArtifactListener$TransformedArtifact.visit(TransformingAsyncArtifactListener.java:213)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.ParallelResolveArtifactSet$VisitingSet$StartVisitAction.visitResults(ParallelResolveArtifactSet.java:99)
org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:56)
at
org.gradle.internal.operations.DefaultBuildOperationQueue$WorkerRunnable.runOperation(DefaultBuildOperationQueue.java:241)
at org.gradle.internal.operations.DefaultBuildOperationQueue$WorkerRunnable.doRunBatch(DefaultBuildOperationQueue.java:222)
at org.gradle.internal.operations.DefaultBuildOperationQueue$WorkerRunnable.lambda$runBatch$0(DefaultBuildOperationQueue.java:212)
at org.gradle.internal.resources.AbstractResourceLockRegistry.whileDisallowingLockChanges(AbstractResourceLockRegistry.java:70)
at org.gradle.internal.work.DefaultWorkerLeaseService.whileDisallowingProjectLockChanges(DefaultWorkerLeaseService.java:185)
org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:50)
at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:47)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
org.gradle.cache.ManualEvictionInMemoryCache.get(ManualEvictionInMemoryCache.java:30)
at org.gradle.cache.internal.DefaultCrossBuildInMemoryCacheFactory$CrossBuildCacheRetainingDataFromPreviousBuild.get(DefaultCrossBuildInMemoryCacheFactory.java:259)
at org.gradle.cache.Cache.get(Cache.java:31)
at org.gradle.internal.execution.steps.IdentityCacheStep.lambda$executeDeferred$1(IdentityCacheStep.java:47)
... 25 more
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: /Users/kingsleyokoye/.gradle/caches/transforms-3/c6c5e6c867a7a9428e59b7cabb0a5c1a/transformed/jetified-fastutil-8.3.0.jar:it/unimi/dsi/fastutil/objects/Reference2DoubleMap.class
at Version.fakeStackEntry(Version_3.0.69.java:0)
at com.android.tools.r8.utils.w.a(SourceFile:68)
at com.android.tools.r8.utils.w.a(SourceFile:28)
at com.android.tools.r8.utils.w.a(SourceFile:27)
at com.android.tools.r8.utils.w.b(SourceFile:3)
at com.android.tools.r8.D8.run(D8.java:11)
at com.android.builder.dexing.D8DexArchiveBuilder.convert(D8DexArchiveBuilder.java:115)
... 115 more
Caused by: com.android.tools.r8.internal.q8: One or more instruction is preventing default interface method from being desugared: java.lang.Double it.unimi.dsi.fastutil.objects.Reference2DoubleMap.getOrDefault(java.lang.Object, java.lang.Double)
at com.android.tools.r8.internal.Ei.a(SourceFile:111)
at com.android.tools.r8.internal.Bi.a(SourceFile:586)
at com.android.tools.r8.utils.V.a(SourceFile:36)
at com.android.tools.r8.utils.V.a(SourceFile:41)
at com.android.tools.r8.utils.V.a(SourceFile:35)
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:69)
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
at com.google.common.util.concurrent.MoreExecutors$DirectExecutorService.execute(MoreExecutors.java:321)
at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:66)
at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:36)
at com.android.tools.r8.utils.V.a(SourceFile:34)
at com.android.tools.r8.internal.sj.a(SourceFile:2)
at com.android.tools.r8.internal.sj.forEach(SourceFile:2)
at com.android.tools.r8.utils.V.a(SourceFile:6)
at com.android.tools.r8.utils.V.a(SourceFile:40)
at com.android.tools.r8.utils.V.a(SourceFile:38)
at com.android.tools.r8.utils.V.a(SourceFile:37)
at com.android.tools.r8.internal.Bi.a(SourceFile:574)
at com.android.tools.r8.internal.Bi.a(SourceFile:560)
at com.android.tools.r8.ir.conversion.k.a(SourceFile:12)
at com.android.tools.r8.ir.conversion.k.a(SourceFile:64)
at com.android.tools.r8.D8.d(D8.java:39)
at com.android.tools.r8.D8.b(D8.java:1)
at com.android.tools.r8.utils.w.a(SourceFile:24)
... 118 more
Suppressed: java.lang.RuntimeException: java.util.concurrent.ExecutionException: com.android.tools.r8.internal.q8: One or more instruction is preventing default interface method from being desugared: java.lang.Double it.unimi.dsi.fastutil.objects.Reference2DoubleMap.getOrDefault(java.lang.Object, java.lang.Double)
at com.android.tools.r8.D8.d(D8.java:209)
at com.android.tools.r8.D8.b(D8.java:1)
at com.android.tools.r8.utils.w.a(SourceFile:24)
at com.android.tools.r8.utils.w.b(SourceFile:3)
at com.android.tools.r8.D8.run(D8.java:11)
at com.android.builder.dexing.D8DexArchiveBuilder.convert(D8DexArchiveBuilder.java:115)
at com.android.build.gradle.internal.dependency.BaseDexingTransform.process(DexingTransform.kt:288)
org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
at
org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:105)
at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:50)
at org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:86)
at java.base/java.util.Optional.orElseGet(Optional.java:369)
at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:86)
at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:32)
at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38)
at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:43)
at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:31)
at org.gradle.internal.execution.steps.AssignWorkspaceStep.lambda$execute$0(AssignWorkspaceStep.java:40)
at org.gradle.internal.execution.workspace.impl.DefaultImmutableWorkspaceProvider.lambda$withWorkspace$3(DefaultImmutableWorkspaceProvider.java:120)
at org.gradle.cache.internal.LockOnDemandCrossProcessCacheAccess.withFileLock(LockOnDemandCrossProcessCacheAccess.java:90)
at org.gradle.cache.internal.DefaultCacheAccess.withFileLock(DefaultCacheAccess.java:191)
at org.gradle.cache.internal.DefaultPersistentDirectoryStore.withFileLock(DefaultPersistentDirectoryStore.java:188)
at org.gradle.cache.internal.DefaultCacheFactory$ReferenceTrackingCache.withFileLock(DefaultCacheFactory.java:209)
at org.gradle.internal.execution.workspace.impl.DefaultImmutableWorkspaceProvider.withWorkspace(DefaultImmutableWorkspaceProvider.java:117)
at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:40)
org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.util.concurrent.ExecutionException: com.android.tools.r8.internal.q8: One or more instruction is preventing default interface method from being desugared: java.lang.Double it.unimi.dsi.fastutil.objects.Reference2DoubleMap.getOrDefault(java.lang.Object, java.lang.Double)
at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:566)
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:527)
at com.google.common.util.concurrent.FluentFuture$TrustedFuture.get(FluentFuture.java:88)
at com.android.tools.r8.utils.V.a(SourceFile:11)
at com.android.tools.r8.utils.V.a(SourceFile:40)
at com.android.tools.r8.utils.V.a(SourceFile:38)
at com.android.tools.r8.utils.V.a(SourceFile:37)
at com.android.tools.r8.internal.Bi.a(SourceFile:574)
at com.android.tools.r8.internal.Bi.a(SourceFile:560)
at com.android.tools.r8.ir.conversion.k.a(SourceFile:12)
at com.android.tools.r8.ir.conversion.k.a(SourceFile:64)
at com.android.tools.r8.D8.d(D8.java:39)
... 126 more
Caused by: [CIRCULAR REFERENCE: com.android.tools.r8.internal.q8: One or more instruction is preventing default interface method from being desugared: java.lang.Double it.unimi.dsi.fastutil.objects.Reference2DoubleMap.getOrDefault(java.lang.Object, java.lang.Double)]
I've tried
adding Multidex enabled
adding dexOptions {
javaMaxHeapSize "4g"
} on my gradle properties file
adding implementation 'com.android.support:multidex:1.0.3'
Making sure my dependencies have specified version numbers
But none seems to work.
This might be caused due to 2 problems-
In your gradle.properties file, have you enabled:
android.useAndroidX=true
android.enableJetifier=true
The jar file might be corrupted. Delete the fastutil-8.3.0.jar file only and let gradle reinstall it.
According to this GitHub ticket there is indeed a problem. Try to roll back the library to an older version (7.2.1 worked for me)

Android Build failed with an exception

FAILURE: Build failed with an exception.
What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
Could not find com.github.parse-community.Parse-SDK-Android:parse:1.12.0.
Required by:
project :app
logcat

Exception while build presto

I am geeting following exception while build presto,
[ERROR] Failed to execute goal io.airlift.maven.plugins:sphinx-maven-plugin:2.0:generate (default) on project presto-docs: Failed to run the report: Sphinx report generation failed -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.airlift.maven.plugins:sphinx-maven-plugin:2.0:generate (default) on project presto-docs: Failed to run the report
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call(MultiThreadedBuilder.java:185)
at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call(MultiThreadedBuilder.java:181)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
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:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to run the report
at io.airlift.maven.sphinx.SphinxMojo.execute(SphinxMojo.java:234)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 11 more
Caused by: org.apache.maven.reporting.MavenReportException: Sphinx report generation failed
at io.airlift.maven.sphinx.SphinxMojo.runForkedSphinx(SphinxMojo.java:405)
at io.airlift.maven.sphinx.SphinxMojo.executeReport(SphinxMojo.java:246)
at io.airlift.maven.sphinx.SphinxMojo.execute(SphinxMojo.java:231)
... 13 more
Guide me how to build presto without any exception.
You can install python and later use the below commands to separately build presto-docs to know detailed error from sphinx, which will help to resolve the build error
pip2 install sphinx
make -C presto-docs clean html

Errors while enabling ProGuard - Android Development

I'm getting following errors while 'Generate Signed APK' when I enable minify on build.gradle. Can anyone show me where is the issue? I'm unable to find since I'm new to android development and it doesn't show any class names related to my files
org.gradle.initialization.ReportedException: org.gradle.internal.exceptions.LocationAwareException: Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
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)
Caused by: org.gradle.internal.exceptions.LocationAwareException: Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
Caused by: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
... 3 more
Caused by: java.lang.RuntimeException: Job failed, see logs for details
at com.android.build.gradle.internal.transforms.ProGuardTransform.transform(ProGuardTransform.java:196)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:221)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:217)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:102)

Jenkins sonar check failure: Caused by: java.lang.ClassNotFoundException: org.sonar.api.checks.NoSonarFilter

When I call Jenkins build job, It throw following error and job failed.*
Can anyone have saw this error?
Jenkins version: 1.642.1
Sonar version: 5.4 (Java plugin 3.5)
Here is the error info:
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.1:sonar (default-cli) on project ods-replicator: Unable to register extension org.sonar.plugins.java.JavaSquidSensor: Lorg/sonar/api/checks/NoSonarFilter;: org.sonar.api.checks.NoSonarFilter -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.1:sonar (default-cli) on project ods-replicator: Unable to register extension org.sonar.plugins.java.JavaSquidSensor
......
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
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)
Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to register extension org.sonar.plugins.java.JavaSquidSensor
at org.sonarsource.scanner.maven.bootstrap.ExceptionHandling.handle(ExceptionHandling.java:36)
at org.sonarsource.scanner.maven.bootstrap.RunnerBootstrapper.execute(RunnerBootstrapper.java:81)
at org.sonarsource.scanner.maven.SonarQubeMojo.execute(SonarQubeMojo.java:112)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 31 more
Caused by: java.lang.IllegalStateException: Unable to register extension org.sonar.plugins.java.JavaSquidSensor
at org.sonar.core.platform.ComponentContainer.addExtension(ComponentContainer.java:241)
...
... 34 more
Caused by: java.lang.NoClassDefFoundError: Lorg/sonar/api/checks/NoSonarFilter;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2583)
at java.lang.Class.getDeclaredFields(Class.java:1916)
at org.picocontainer.injectors.AdaptingInjection$2.run(AdaptingInjection.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at org.picocontainer.injectors.AdaptingInjection.injectionFieldAnnotated(AdaptingInjection.java:209)
at org.picocontainer.injectors.AdaptingInjection.fieldAnnotatedInjectionAdapter(AdaptingInjection.java:188)
at org.picocontainer.injectors.AdaptingInjection.createComponentAdapter(AdaptingInjection.java:57)
at org.picocontainer.behaviors.AbstractBehaviorFactory.createComponentAdapter(AbstractBehaviorFactory.java:44)
at org.picocontainer.behaviors.OptInCaching.createComponentAdapter(OptInCaching.java:45)
at org.picocontainer.DefaultPicoContainer.addComponent(DefaultPicoContainer.java:536)
at org.picocontainer.DefaultPicoContainer.access$300(DefaultPicoContainer.java:84)
at org.picocontainer.DefaultPicoContainer$AsPropertiesPicoContainer.addComponent(DefaultPicoContainer.java:1149)
at org.sonar.core.platform.ComponentContainer.addExtension(ComponentContainer.java:239)
... 63 more
Caused by: java.lang.ClassNotFoundException: org.sonar.api.checks.NoSonarFilter
at org.sonar.classloader.ParentFirstStrategy.loadClass(ParentFirstStrategy.java:39)
at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:87)
at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:76)
... 77 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
The listed compatibility for the version 3.5 of the Java plugin ends at 5.1. There have been API changes in the 5.x series, so this can probably be solved with an upgrade of the Java plugin.

Categories