The application name on SonarCloud portal is different

  • ALM used : GitHub
  • CI system used : Circle CI
  • Languages of the repository : Java, Kotlin
  • Error observed : No errors.
  • Steps to reproduce : Commit code to Github, CircleCI Build starts, Analysis on Sonar Cloud
  • Potential workaround : None identified

Hello Team,

The application name of our Android project was previously reflecting correctly on SonarCloud Portal, but now the name is different. It takes the name of root folder automatically. Kindly help us resolve this issue. How can we reflect the original application name, instead of application’s root directory name.

Thank you.

Can you add some screenshots that demonstrate the issue you’re facing?

Hi @Colin,
Thank you for the response !

Please find attached the screenshot. At the top left, where ‘app’ is displayed, previously, it used to be ‘android-mobile-app’. How do I change the name back to ‘android-mobile-app’.

Thank you.

I’ve had the same issue, but you can change the project name in your Gradle file.

Just add the property sonar.projectName to the sonarqube section with your required project name and it will start showing up with that name instead of app.

For example:

sonarqube {
  properties {
    property "sonar.projectKey", "sonar_projectKey"
    property "sonar.organization", "organisation"
    property "", ""
    property "sonar.projectName", "android-mobile-app"

Tip: You can also set this so a real project name, like "My SonarCloud App" if desired.

To add on to @Piro’s excellent response (it is indeed possible to “force” sonar.projectName), the SonarScanner for Gradle is picking up defaults, in this case using ${} as the value passed to sonar.projectName.

To @KanishakCharitableIm – I would reccomend making sure this value hasn’t changed (it probably sits in your settings.gradle file)

1 Like