How to Share Resources in KMM (Strings, Images, etc.)

preview_player
Показать описание
In this video I'll show you how you can use resources in the shared module of your KMM project.

Save your free spot at my live freelance workshop on finding the right clients:

Get my FREE PDF about 20 things you should never do in Jetpack Compose:

Get the source code for this video here:
Рекомендации по теме
Комментарии
Автор

Yesterday i was in pain with Moko resources, but not now anymore Thank for this vidéo Phil 🙏

darrenlambert
Автор

Thank so much Philipp for this tutorial, thanks to this I was able to setup moko resources library into my project after 2 days of spending time on it.

MarioManza
Автор

I am waiting the new KMM course on your website, and thank for the tutorial~

yuuzuX
Автор

FOR THOSE WHO HAVE THE ERROR:
reference to member "toUIImage" cannot be resolved without a contextual type -
You must explicitly type shared.ImageResource ("shared" here is the shared module name). There are two ImageResource classes: from shared module and from ios module

loltAB
Автор

Another AWESOME and truly useful video, thanks a lot Phillip!!!🙏

ykalchev
Автор

Expect object 'MR' has no actual declaration in module<composeApp_release> for JVM I am getting this error can you help me out to resolve

prityburnwal
Автор

Great workk !! I am looking forward to hear you a video about compose multiplatform with one viewmodel ios and android in KMM

emremuhammetengin
Автор

I watched your interview on the Kotlin channel it was really good.

raghu
Автор

So relevant for me right now, thanks!

scottmiddleton
Автор

I had a problem with moko once. They have made a fantastic library but I needed to update the version and it was such a pain, everything was crashing. And the point is, resources is such a wide spread functionality. I suggest to at least make an adapter pattern for shared resources, so that it would be at least easier to switch it if this doesn't work out for you anymore

mikeshilovski
Автор

Hey Philipp, great video, you strike it where it really matters, let's put as much as possible in the shared dir.

Also, since it can be done with JPG-s, how does iOS understand the SVG (vector drawables) of Android? How can we use it on iOS as well? A sequel for this video would be one discussing those SVG-s ;)

tommy
Автор

I am using Compose Multiplatform with a shared UI codebase, so since the actual Android function needs context, this will not work.

yurowitz
Автор

Excellent explanation, thanks for sharing

LeonardoMorales
Автор

Thank you! But unfortunately it is not working on iOS (or not working anymore). Even when I clone your sample, it doesn't work on XCode. I think it also needs a run script addition in the XCode build phase. (I am getting an error like "PhaseScriptExecution failed with a nonzero exit code)

oyacanl
Автор

Good job! I am waiting for a video with pagination 😊 And kmm flow :). And one viewmodel for android and ios :))

roshkaalex
Автор

dose the moko library need cocoapods project? Or it's work perfectly fine on regular framework?

pavelshelkovenko
Автор

Hi Phillip, great info here.. I have one more question, . do you have any example that how to use moko lib for colours and files as well ?

chetandobariya
Автор

i am getting this error can someone help
Cannot change attributes of dependency configuration after it has been resolved

youssefhachicha-njwf
Автор

Can u share the audio file in common source?

easyenglish
Автор

Awesome, now could you show us how to do it with compose multiplatform 😊

galaxiegalaxie