I am trying to configure SonarCloud to work in my build pipeline on DevOps: my project is Android application, so I’m using the Gradle integration in the
This is my pipeline:
trigger: - master pool: vmImage: 'macOS-latest' steps: - task: SonarCloudPrepare@1 inputs: SonarCloud: 'SonarCloud' organization: 'pillohealth' scannerMode: 'Other' - task: Gradle@2 displayName: 'Test' inputs: workingDirectory: '' gradleWrapperFile: 'gradlew' gradleOptions: '-Xmx3072m' publishJUnitResults: true testResultsFiles: '**/TEST-*.xml' tasks: 'lint connectedAndroidTest' - task: Gradle@2 displayName: 'Build' inputs: workingDirectory: '' gradleWrapperFile: 'gradlew' gradleOptions: '-Xmx3072m' tasks: 'assembleRelease' sonarQubeRunAnalysis: true
But everytime I run the pipeline, I always get the following error:
> Task :sonarqube FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':sonarqube'. > You're not authorized to run analysis. Please contact the project administrator.
I am definitely authorized to run analysis, since I am an administrator of both the organization and the project. I have also verified permissions in the Permissions section of the project and I have given my account unlimited access. The
SonarCloud service connection is configured in DevOps using a personal token that I have generated from my account in SonarCloud.
I have followed almost any tutorial that I could find… In particular, I’ve read:
But all these guides are .NET focused and some of them don’t even mention Gradle compatibility.
What am I doing wrong?
Thanks in advance.