


Now you can easily link shared code with your main project, just add this line of code inside you android.app module. Here you could find all the information about gradle plugin configurations and supported platforms Ĥ) And that’s it, you are ready to go. To make it work you need to change Shared adle file apply plugin: 'kotlin-multiplatform' kotlin

Create a new multiplatform-project throught IntelliJ IDEA.

You can find more details here Įxpected is inside the commonMain package import expect val ApplicationDispatcher: CoroutineDispatcherĪctual is inside the androidMain (iOSMain, jsMain etc…) package import import actual val ApplicationDispatcher: CoroutineDispatcher = Dispatchers.IO Kotlin multiplatform introduced two new keywords: expect and actualĮxpected is used inside the commonMain to notify the compiler that shared part of your code requires some platform-specific implementation, while actual is the way of telling the compiler that you have provided a platform specific implementation and shared module is ready to go. This is the only sourceSet that would be available from all existing platforms, basically, all shared logic will be here. Every sourceSet folder is separated from the others except commonMain.
