jQrgen
11/04/2025, 5:17 AMorg.jetbrains.kotlin.Android superfluous when org.jetbrains.kotlin.multiplatform is applied, or should I use both? The project has iOS, Android, and desktop targetsJack Boswell
11/04/2025, 5:30 AMjQrgen
11/04/2025, 5:54 AMJack Boswell
11/04/2025, 6:05 AMjQrgen
11/04/2025, 6:17 AMSudarshan
11/04/2025, 6:26 AMSudarshan
11/04/2025, 6:28 AMandroidLibrary() target with androidTarget() and use the "`com.android.application`" plugin.efemoney
11/04/2025, 12:54 PMzsmb
11/04/2025, 1:32 PMcomposeApp module), the same module has the KMP plugin and the Android application plugin applied.
In AGP 9 however, applying the regular Android app or regular Android library plugin in a KMP module will be deprecated, and it's planned to be completely prohibited in AGP 10.
There's a new Android KMP library plugin specifically to be used in KMP modules in combination with the KMP plugin. When using this, the entry point of the Android app (which uses the Android application plugin) must be a separate module from the KMP module.
We'll be updating the default structure of the wizard to match this requirement and use the new Android KMP library plugin, moving the application entry points for each platform into separate modules (brief example shown here). This is still a work in progress though, as the Android KMP library plugin has some known issues and incompatibilities that we don't want to impose on users (primarily, it breaks common previews) - so we'll ship the new structure once bugfixes land in stable releases.zsmb
11/04/2025, 1:39 PMandroidTarget block to add the Android target and configure Android-related things.
• If you want to modularize, have a separate module with the Android entry point using the Android application plugin and the Kotlin Android plugin, with no KMP involved. You can then make this app module depend on a separate KMP library module, where you use the regular Android library plugin and the KMP plugin for now (once again, using the androidTarget block to configure things).
• Don't use the new Android KMP library plugin yet, unless you're adventurous and want to be on the bleeding edge (this would use the androidLibrary block to add the Android target to your KMP setup).efemoney
11/04/2025, 2:47 PMandroid block, not androidLibrarydorche
11/04/2025, 4:11 PMThis is still a work in progress though, as the Android KMP library plugin has some known issues and incompatibilities that we don't want to impose on users (primarily, it breaks common previews) - so we'll ship the new structure once bugfixes land in stable releases.Are there any issue tracker links that we can monitor to know when these fixes land?
zsmb
11/04/2025, 4:20 PMKaren Frangulyan
11/06/2025, 1:16 AMOtter 2025.2.2 (canary) and AGP 9.0.0-alpha13. Another comment there says I have to upgrade CMP to 1.10.0-... .
This all triggered a chain reaction of project restructurings, which I tried to contain by adding android.builtInKotlin=false and android.newDsl=false in gradle properties in order not to be forced to refactor composeApp module and separate the Android app module for now.
Furthermore, it turned out Previews are changed in 1.10.0-beta01 , which I’m still trying to figure out where to put in gradle file and use in common code. I’m seeing an error like:
:core:shared:appleMain: Couldn't resolve dependency 'org.jetbrains.compose.ui:ui-tooling' in 'appleMain' for all target platforms.
when I try to put it in commonMain sourceset dependency of my shared module. The “what’s new” article doesn’t mention how the new Previews need to be set up in gradle files.Karen Frangulyan
11/06/2025, 2:16 AMJack Boswell
11/06/2025, 2:20 AMKaren Frangulyan
11/06/2025, 2:32 AM