evant / kotlin-inject

Dependency injection lib for kotlin
Apache License 2.0
1.29k stars 60 forks source link

IosMain does not see generated code in Build folder. #428

Open Monabr opened 2 months ago

Monabr commented 2 months ago

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?

evant commented 2 months ago

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

Monabr commented 2 months ago

@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

evant commented 2 months ago

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