This is a Kotlin Multiplatform project targeting Android, iOS.
-
/androidApp contains Android applications.
-
/iosApp contains iOS applications. Even if you’re sharing your UI with Compose Multiplatform, you need this entry point for your iOS app. This is also where you should add SwiftUI code for your project.
-
/shared is for the code that will be shared between all targets in the project. The most important subfolder is commonMain. If preferred, you can add code to the platform-specific folders here too.
When creating a new project based on this template, you need to modify the following:
-
Project Name in settings.gradle.kts:
- Open the
settings.gradle.ktsfile in the root of your project. - Change the
rootProject.nameattribute to your desired project name.rootProject.name = "YourNewProjectName"
- Open the
-
Android Application ID:
- Open the
build.gradle.ktsfile located in theandroidAppmodule (./androidApp/build.gradle.kts). - Modify the
applicationIdwithin thedefaultConfigblock to your unique application ID.android { // ... defaultConfig { applicationId = "com.yourcompany.yournewprojectname" // ... } // ... }
- Open the
-
iOS Configuration (Config.xcconfig):
- Open the
Config.xcconfigfile located in theiosApp/Configurationdirectory (./iosApp/Configuration/Config.xcconfig). - Update the necessary values such as
APP_ID(Bundle ID) andAPP_NAME(Display Name) with your project-specific information.APP_ID = com.yourcompany.YourNewProjectName APP_NAME = YourNewProjectName
- Open the
It is recommended to install and run kdoctor to verify that your development environment is correctly set up for Kotlin Multiplatform development. kdoctor helps diagnose and fix common configuration issues.
Learn more about Kotlin Multiplatform