Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kotlin - Multi platform feature

I'm currently playing around with Kotlin multi platform feature and have a minor problem. When I start gradle multi-platform project in Intellij and use keywords 'actual' and 'expect', they are underlined in red and show message "The feature "multi platform projects" is experimental and should be enabled explicitly"

How can I explicitly enable multi platform feature? Thanks

like image 959
P. Habzansky Avatar asked Feb 18 '18 13:02

P. Habzansky


People also ask

What is Kotlin multi platform?

 Kotlin Multiplatform Mobile (KMM) is an SDK for cross-platform mobile development. You can develop multiplatform mobile applications and share parts of your applications between Android and iOS, such as core layers, business logic, presentation logic, and more.

Can we use Kotlin for cross-platform?

Cross-platform development beyond mobile With Kotlin Multiplatform, you can create different multiplatform projects for multiple platforms, including web, desktop, and other native platforms. Kotlin applications will work on different operating systems, such as macOS, Windows, Linux, Android, iOS, watchOS, and others.

Is Kotlin multiplatform good?

Kotlin Multiplatform Mobile (KMM)Kotlin is an excellent choice for creating mobile apps. Its conciseness, simplicity, and expressivity make it simple to develop correct and understandable code. If you're starting a new native Android project, Kotlin is the recommended language.

How does Kotlin make cross-platform?

In Android Studio, select File | New | New Project. Select Kotlin Multiplatform App in the list of project templates, and click Next. Specify a name for your first application, and click Next. In the iOS framework distribution list, select the Regular framework option.


1 Answers

Finally found an answer. In Intellij in Preferences->Build, Execution, Deployment->Compiler->Kotlin Compiler append to Additional command line parameters: field command -Xmulti-platform.

enter image description here

like image 96
P. Habzansky Avatar answered Sep 29 '22 22:09

P. Habzansky