Auto scan in kotlin project

Hello, I’m trying the product and I have two questions:

    1. On our Android project full kotlin, the automatic scan don’t work. We have to activate the gradle plugin or use a CI and it is a showstopper for us. We are expecting a button to scan a branch and setup the project without requiring any server.
  1. How to have several branchs scanned easily (not PR)? We need to focus on two branches : master and a branch feature/xxx, but the feature in “Detection of long-lived branches” seems not working.

Thank you for your help

Hey Nicolas.

Can you go into some more details? What exactly isn’t working? What happens when you try?

As noted in the documentation on Automatic Analysis, only analysis of the main branch and pull requests are supported, not other branches.

  • Branch analysis (analysis of non-pull request branches other than the main branch) is not supported.
  1. It is working fine for PR, but for the main project we have an error: “AX7ZfA7vMHOIDU0BEJNF” has failed: the analysis of your project exceeded the maximum memory available for automatic Analysis".

  2. How can I change my main branch to an specific branch? I need master and develop.

Hey there.

Thanks for providing the analysis ID.

The issue comes from it being a very first analysis with a lot of SCM (git) data to load. This bottleneck in analysis is something we’re looking to improve, but in the meantime, you might try switching to CI-based analysis (it may take a while for the first run). If you have trouble running a CI-based analysis we’ll be happy to help you troubleshoot.

After the initial run, you might be able to switch back to Automatic Analysis – but your mileage may vary.

As noted, with Automatic Analysis analyzing multiple branches won’t be possible. Only the main branch of your repository (the default one in GitHub) will be analyzed. It isn’t possible to switch this. To analyze multiple branches, you’ll need to switch to CI-based analysis.

we have tried to push a small code update (4 lines) on master on main branch on our Android project, it is working fine on auto-scan on PR but not on master.

Here is the error : The last analysis has failed. If it keeps on failing after several attempts, please contact us on Community forum and provide the following failing analysis ID: “AX-rs87PwsfjvxW8WgpM”.

PS: It is still unclear on our side how is sonarcloud working with PR/main branches and Long-lived branches.

Thanks for your help

Hey there.

When the main branch is analyzed, blame data is collected for all files which, in this case, fails with Automatic Analysis.

CI-based analysis remains the best solution, for now, for consistently successful analyses, until we tackel the root cause.