kotlin-inject icon indicating copy to clipboard operation
kotlin-inject copied to clipboard

IosMain does not see generated code in Build folder.

Open Monabr opened this issue 1 year ago • 3 comments
trafficstars

Hi.

AndroidMain generates and uses it component, but iosMain generates component but does not see it from build folder so it can not use it and ios project does not compile with error: Unresolved reference 'create'

How to fix this issue?

Monabr avatar Sep 06 '24 00:09 Monabr

Have you taken a look at https://github.com/evant/kotlin-inject-samples/tree/main/multiplatform/greeter? It's our sample for multiplatform setup

evant avatar Sep 06 '24 16:09 evant

@evant The problem was solved after in iosMain in file with my IosCompoment I wrote

@KmpComponentCreate
expect fun IosCompoment.Companion.create(): IosCompoment

I believe docs should highlight this moment for iosMain

Monabr avatar Sep 06 '24 21:09 Monabr

It's detailed in https://github.com/evant/kotlin-inject/blob/main/docs/multiplatform.md but yes the docs can use improvements https://github.com/evant/kotlin-inject/issues/389

evant avatar Sep 07 '24 01:09 evant