I'm struggling with my first project on KMP.
I creat a project simple from KMP plugin in IntilijIdea.
Creating all the necessary module for me: Android, Desktop and web.
After trying hard I succeeded in making Desktop and Web part compile
The problem is with Android part it doesn't compile.
And finally I created KMM project using Android Studio
It works correctly but I failed to add it with the desktop and web project
What I have to do ?!
Is there any willing from Jetbrain team to improve the user experience with the plugin and the default project sample ?! 😢
By the way, I'm just a student have prior knowledge with Android (Kotlin/Java)
But I have to make a website and Android App to my school
So I think Kotlin multiplatform is the best choice as I master Kotlin
So I'm asking if any one can help me in the gradle files
And also if my choice of KMP is right ?!
Or I have to pick another technology like Flutter/ React native instead
07/06/2021, 5:50 PM
Android is a special snoflake in kmp. Best move it to an isolated module that in itself depends on kmp module
This way android stuff is the same as for any other app and your kmp bit becomes just a local lib for it
07/06/2021, 5:54 PM
Now I have two project
One for Android
And one for Desktop and Web ...
What are the steps to do to integrate Android with them ?!
I mean I want to use shared module to write one logic
07/06/2021, 5:56 PM
Create kmp module and declare jvm and js targets (you can depend on jvm jars from android app). If android complains, try adding android target to kmp module too.
Then just add it to app module dependencies via implementation(project (":my-kmp-module"))
07/06/2021, 5:58 PM
I will try last chance
I really appreciate your help
07/06/2021, 5:58 PM
PM me if you get stuck. Happy to hop on screen share to sort you out.
Also full disclaimer - I'm an android noob 😀
07/06/2021, 6:27 PM
So, I had a real hard time when I first started too. I found that the KMM plugin in Intellij didn’t work for me. I had to use the one in Android Studio (Canary).