Sonar Qube build errors Android

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    We are running the Sonarqube Developer Version 8.9.1 (build 44547) using docker image sonarqube:8.9.1-developer.

  • what are you trying to achieve?
    We are trying to run an android project (Gradle based) using Jenkins

  • what have you tried so far to achieve this
    We have done the following

  1. Created a Multibranch Pipeline Job
  2. Created a GitHub Webhook
    3). Create a Jenkinsfile

Hi,

Welcome to the community!

You’ve listed a few of the steps you’ve taken. Can you go further? Your subject references errors. Can you share your build/analysis log?

 
Ann


Build error screen shot .

Build gradle configuration :

Hi,

This isn’t the place for general Gradle file debugging. And yet, the error seems pretty clear…

 
:woman_shrugging:
Ann

Not super clear why this build error is thrown . We have added the script as specified in the sonarqube pre requisite.
We are trying to identify what missing with sonarqube integration.
It would be great help if you point out what we missing.
If this is not the forum please direct to right point of contact

Hi,

The error is:

All buildscript {} blocks must appear before any plugins {} blocks in the script

Your screenshot shows that the plugins block was inserted at the beginning of your file, before the buildscript block.

I guess you were thrown by the documentation wording “First, include the scanner in your build…”. It’s the first thing to do, but apparently shouldn’t be the first thing in the file. I’ll bring that to the attention of the docs folks.

 
Ann

I have the same problem, and it does not matter if I put plugins after buildscript … can you please elaborate more on a possible solution?