Open gchristov opened 3 years ago
Turns out I had to do this in my iOS setup, which makes sense as iOS doesn't have access to the generated code by default I believe. Might be worth updating the docs on the README page in case this continues to be maintained 👍
val iosMain by getting {
...
kotlin.srcDir("${buildDir.absolutePath}/generated/source/kaptKotlin/")
}
I'm following the setup instructions but running into an issue trying to inject a dependency on iOS in a kotlin multiplatform project. I have:
Bridge.kt
file in my iOS source set with the following contents:fun getInjector() = InjectorObjC(popKorn())
@Injectable class PopKoIos { fun te() = println("TE") }
BridgeKt.doInit { (clazz) -> PopkornMapping in return clazz.alloc() as! PopkornMapping }
let injector = BridgeKt.getInjector() let helloWorld = injector.inject(clazz: PopKoIos.self) as! PopKoIos <- THIS FAILS helloWorld.te()