Hey guys, I am I doing this wrongly or? I have a s...
# koin
n
Hey guys, I am I doing this wrongly or? I have a single activity approach with multi feature modules with their fragments and VM's. Now I have a DI package in my Module A with repository, network and VM koin modules. This is what I am doing at the moment. I just reference those 3 modules from the other package.
Copy code
open class App : Application() {

    override fun onCreate() {
        super.onCreate()
        startKoin {
            // Android context
            androidContext(this@App)
            // modules
            modules(com.example.core.di.networkModule, (com.example.homeFeed.di.)viewModelModule, (com.example.homeFeed.di.)repositoryModule, com.example.homeFeed.di.networkModule)
        }
    }

}
But I crash with this as the output https://hastebin.com/qizixidumu.sql Also is there a better way to handle koin modules in a multimodule app? Like having an array of modules and then just loading them when needed as the fragments change? Thank you!
a
Just to confirm, did you add your App to the manifest? Adding modules looks correct. This is also running on a device, and not a test correct?
n
@Allan Wang I did yes, it has worked on the Core module, but then I added the HomeFeed module and it started crashing. But in theory it should work? If thats the case I'll go hunting for the cause
It crashes once I navigate to the new Module
a
I don’t see how adding homefeed should stop it from recognizing the koin application. If it’s missing a dependency that’s different though
what does “navigating to the new module” mean
n
@Allan Wang Single activity, go to a fragment in another module
a
is network in a separate module as well? Did you end up adding a new android module when adding the new koin module?
If you’re not sure you can try building the app and checking the manifest just to make sure the application name (referencing .App) still exists
n
@Allan Wang Thank you! That was it. The .App was missing