Support for KMP/CMP (AGP 9.1+)

Hi!

I was wondering whether latest versions of Kotlin Multiplatform and Compose Multiplatform are supported (When used with Android Gradle 9.1) - I saw posts about KMP support that was added back some time ago, but I tried using it on my project and the auto analysis seems to only analyze some two nested subfolders and adding the SonarQube to CI was throwing an error about expecting some legacy naming from Android project, so I’m either not really sure how to make this work, or there seems to be some kind of incompatibility?

The SonarQube in IDE is doing the trick for now, but I’d love to be able to see the bigger picture too.

Cheers!

Ah, just searched for more topics on this matter, it looks like AGP 9.1.0 isn’t supported by SonarQube. In that case, this post might be closed, merged or deleted I guess.

1 Like

Hello @gjsjohnmurray !

If by the error on CI you mean an exception from sonarResolver task, then, indeed, there is a known incompatibility between AGP 9 and Sonar scanner for Gradle, as explained in this thread. You can try the workaround proposed there.

If you manage to get SonarScanner for Gradle to working, there is one more detail: right now, it will only run analysis on JVM-related files (i.e. src/main/kotlin and not specific source sets). To change this behavior, you can run the analysis with -Dsonar.gradle.scanAll=true(or adding systemProp.sonar.gradle.scanAll=true to gradle.properties).

Hope that helps,

Peter

1 Like