How to Migrate an Android Project to Kotlin Multiplatform (KMP)
Vložit
- čas přidán 11. 07. 2024
- In this video, you'll learn how you can take an existing native Android project in Android Studio and migrate it to Kotlin Multiplatform, so you can use the app on iOS as well.
🏴🏴🏴 PL CODING BLACK WEEK - Save up to 50% on ALL premium courses and bundles:
pl-coding.com/premium-courses...
💻 Let me be your mentor and become an industry-ready Android developer in 10 weeks:
pl-coding.com/drop-table-ment...
Get my FREE PDF about 20 things you should never do in Jetpack Compose:
pl-coding.com/jetpack-compose...
Regular programming advice on my Instagram page:
/ _philipplackner_
Join my Discord server:
/ discord
Kotlin Multiplatform iOS setup guide:
www.jetbrains.com/help/kotlin...
Kotlin Multiplatform is stable - blog article from JetBrains:
blog.jetbrains.com/kotlin/202...
It was a good tutorial, but it would be better if you now create one in which you migrate this project to share the UI as well with compose multiplatform.
Thanks a lot Philipp
I was already trying to figure out how to do it but you just went and gave an answer
My hero! thank you very much! amazing job Mr. Lackner
Great job Philipp!
thanks for this video
LETS GOOOO 🎉
Nice video Philipp. Have u tried Fleet ide?
Nice live Philipp 🎉😊
If you don't see option of creating a KMP module, you need to turn on experimental settings:
In Android Studio settings, turn on the Enable experimental Multiplatform IDE features option in the Advanced Settings section.
Great work @philipp lackner Just wandering how we can do it for android library. Can we have a tutorial on this, that would be really helpful. Thx
Hey Philipp, do you have any tutorials on how to dynammically load KMP modules, specifically for Web projects? I want to reduce the size of my initial download every visitor needs to download.
Hey Philipp, does the premium course use a multi modular architecture?
I have a multi modular project using CLEAN on Android and would like to migrate to use KMP for the new iOS project.
Cheers for the tutorial.
In the real project, there will be lots of work on the migration. Most of the libraries (written in java) that we use on the native android app doesn't work on KMP. This needs to be replaced with the KMP support libraries.
Wow, Flutter dependency configuration is so much easier. "flutter pub get [your desired package]".
But thanks for an informative tutorial as usual!
Hi Philipp, I have a question and hope you will answer it for me.
We interact between view and viewmodel using state variable and onEvent function written in viewmodel. Because all states are written into State data class (Ex: HomeState), when there is an event such as click the button or enter text in textfield, onEvent function will be called. This will result in the state variable being assigned a new value, and all views related to this state variable in the Screen will be recomposed. This is something we do not want to happen. Can you give me some solution to fix this?
Thank you so much... ❤
Great job @philipp lackner I have one question from kotlin DSL or version catalog which one is better than for handling dependencies?
both are independent things. but you can use version catalog, its pretty handy and easy to use
please make a tutorial video about how to configure dekstop, ios android KMM.
Philipp, do you think it would be wise to do all the Domain and Data layer using KMM and the presentation later using Flutter?
I have a question.if I use window.Can I run KMP without plugin xcode ios right?😢😢
I got an old MacBook that runs iOS simulator, is it possible to run xcode on my M1 and run iOS app on the old MacBook?
Please make a tutorial to make desktop app from existing Android app project
KMM 🎉
Can you make GitHub available, commit before and after migration, please
I ask for a tutorial on how to migrate the JVM library to Kotlin multiplatfrom?
I must say i never understand gradle but currently i am learning libgdx because i was suprised kotlin can be used and run the .apk on android. And its working. Maybe later i will try this (compile into apple).
Is that a 2d engine?
Gradle sucks and it’s a required pain point for android dev
@@ChrisAthanas i was able to follow a tutorial from gamefromscratch youtube channel and render a 3d model with animation in my android phone. But it uses JSON library if not mistaken to parse the .g3db (the binary format) of the model's object file . If you want it to parse its respective text format which is .g3dj it can do it as well. But currently, i want to figure out how to configure the camera for controlling the model's movement.
I don't get the sharedModule option in 4:10 although I have the KMP Plugin installed. I can also create a new KMP Project.
I'm having the same problem. I'm using Android Studio Hedgehog if that means anything.
Ultimately, I copied the "shared" module from the second project and pasted into the original. Hopefully that works.
That’s because of the earlier version of the KMP plugin used in the video. I believe this feature was later marked as experimental and in doing so was removed from being shown. You can enable it by going into Android Studio settings and search for ‘kotlin’ under Advanded Settings. A search result ‘Enable experimental Multiplatform IDE features’ should pop up. Enable it, hit apply and restart Android Studio. The option should now show up when you try to create a new module.
@@marcelbreas3544 thank u guys, i faced the same problem. Ur workaround resolved the problem! Best wishes
@@marcelbreas3544 thank you, this worked.
@@marcelbreas3544 Thanks, making the video is easy but answering questions, apparently not
Hi Philipp,
Can we modularize KMP app? For instance, separate the layer of data-domain-presentation?
Yes not a problem for kmp
I have been banging my head over this, while you can you have to manage ios frameworks which so far i have had no luck or the skill to perform. At first I went in with the idea of creating my featureA module and have for example featureA ui in Compose and featureA with swiftUi in ios and the common code between them and then import that featureA to the main module, but no that doesn't work or i haven't managed to do it yet, or don't even know if it is possible at this point
a video on this would be great @PhilippLackner
There is the KMM course from Philipp where he covers this in details. I am suggesting also to read some articles and case studies to broaden your knowledge 😊. Ex. Touchlab.
Can we use the new editor Fleet IDE to write the ios code on a windows pc instead of mac xCode IDE ?
Likely true but the standard for android will be android studio for next couple years
No to write and test ios apps you need a mac
Getting 'Failed building KotlinMPPGradleModel" error how to solved it.
IDK man, I appreciate the video, but it's no different from the docs, and you easily consume the docs better. Or maybe it's just me, because if I watched this first I would have to rewatch scenes over because of all the zipping around. But looking at the comments, I guess everyone has their preference. I was hoping watching this I would get something more.
I am on windows PC, i cant use the IOS modules, and it gives a ton of error. What about it
Sorry you need a Mac for the iOS side
You need to have XCode which is only available on macOS, because... Apple.
is kmm or kmp is best choise
KMP is the new name for KMM
Hey. I did code android back then. Then i learned a little web development. But now i can say that coding android was much more fun to me. What do you think is it worth learning android dev in 2024 ? Is there demand ?
With KMP it will be the way to produce cross platform apps
@@ChrisAthanas hmm, that is great reason to come back. I'll think about it
Hi. Is your KMM course 69.00£ or 69,00£? Please clarify.
??
@@ahmadab9666 pl-coding Website he has his courses. There I saw the price for KMM to be £69,00. That's why I asked whether it is £69 or £69,00.
69 euros. How the decimal is interpreted differs per region
I remember Kotlin Multiplatform "mobile" is deprecated 🧐
Also you should make part two of this video on add KMP code to existing android projectto run it on iOS. Just a simple hello world would do.
I would rather just git clone and existing template and transfer my Android code to it
1st
Anyone getting this error clang: error: no such file or directory: ' -framework shared'
i have error "org.gradle.api.plugins.UnknownPluginException: Plugin [id: 'com.android.application', version: '8.1.2', apply: false] was not found in any of the following sources:
"
😂😂😂... Google Dart has already started interop with JVM... RIP kotlin soon..
is kmm or kmp is best choise
KMP is the new name of KMM