Gradle sonarqube is failing for an Android project

Template for a good bug report, formatted with Markdown:

  • versions used (SonarQube, Scanner, Plugin, and any relevant extension)
    SonarQube - 9
    implementation ‘com.google.firebase:firebase-crashlytics:18.1.0’

  • error observed (wrap logs/code around triple quote ``` for proper formatting)
    WARNING:: Please remove usages of jcenter() Maven repository from your build scripts and migrate your build to other Maven repositories.
    This repository is deprecated and it will be shut down in the future.
    See JCenter service update  |  Android Developers for more information.
    Currently detected usages in: root project ‘academic’, project ‘:app’

Task :app:injectCrashlyticsMappingFileIdDevDebug FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem was found with the configuration of task ‘:app:injectCrashlyticsMappingFileIdDevDebug’ (type ‘InjectMappingFileIdTask’).

    • Type ‘com.google.firebase.crashlytics.buildtools.gradle.tasks.InjectMappingFileIdTask’ field ‘resourceFile’ without corresponding getter has been annotated with @OutputFile.

      Reason: Annotations on fields are only used if there’s a corresponding getter for the field.

      Possible solutions:

      1. Add a getter for field ‘resourceFile’.
      2. Remove the annotations on ‘resourceFile’.

      Please refer to Dealing with validation problems for more details about this problem.

  • Try:
    Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Exception is:
    org.gradle.internal.execution.WorkValidationException: A problem was found with the configuration of task ‘:app:injectCrashlyticsMappingFileIdDevDebug’ (type ‘InjectMappingFileIdTask’).

    • Type ‘com.google.firebase.crashlytics.buildtools.gradle.tasks.InjectMappingFileIdTask’ field ‘resourceFile’ without corresponding getter has been annotated with @OutputFile.

      Reason: Annotations on fields are only used if there’s a corresponding getter for the field.

      Possible solutions:

      1. Add a getter for field ‘resourceFile’.
      2. Remove the annotations on ‘resourceFile’.

      Please refer to Dealing with validation problems for more details about this problem.
      at org.gradle.internal.execution.WorkValidationException$BuilderWithSummary.build(WorkValidationException.java:109)
      at org.gradle.internal.execution.WorkValidationException$BuilderWithSummary.get(WorkValidationException.java:91)
      at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:97)
      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 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.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution$2.withWorkspace(ExecuteActionsTaskExecuter.java:283)
      at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:40)
      at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:30)
      at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:37)
      at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:27)
      at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:49)
      at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:35)
      at org.gradle.internal.execution.impl.DefaultExecutionEngine$1.execute(DefaultExecutionEngine.java:76)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:184)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:173)
      at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:109)
      at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
      at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
      at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
      at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
      at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
      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.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:76)
      at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:76)
      at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
      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.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
      at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
      at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
      at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
      at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
      at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)

  • Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
Use ‘–warning-mode all’ to show the individual deprecation warnings.
See Command-Line Interface

BUILD FAILED in 1s
4 actionable tasks: 1 executed, 3 up-to-date

  • steps to reproduce
    gradle sonarqube

Please help. TIA.

Hello,

I’m struggling to understand why you are saying that the culprit is SonarQube. There is nothing in what you shared showing that the SonarScanner for Gradle is failing.

Are you able to build without invoking the “./gradlew sonarqube” task?

Alex

1 Like