Hi Everyone, I hope anyone could help me dealing w...
# android
e
Hi Everyone, I hope anyone could help me dealing with a bug related to Koin dependencies in an Android Project. The app crashes when the app is starting... but it doesn't happen always. It's random when it happens and only in Production. When running the app in Debug, it works fine. We got a firebase track log from prod... here it is:
Copy code
Caused by: org.koin.core.error.InstanceCreationException: Could not create instance for '[Singleton: 'com...UpdateInteractor']'
base on the full trace log, it seems to be triggered by a dependency required on
MainActivity -> onStart()
But I have all the injectors well defined on the Koin modules. After a lot of back and forth... I found a way to reproduce similar issue in debug env, which is in the Koin module class, when creating the module setting the parameter
createdAtStart = true
(by default false), it makes the app crash when it's starting... throwing similar trace log than prod. It seems to be like a race condition issue, but still figuring out what is the real cause of that. If anyone have faced any similar issue dealing with Koin dependencies, I would appreciate any help. I found someone here in the past faced similar issue, but didn't post any solution.
j
I am no expert but definitely sounds like a timing issue, is there a way to check the dependency on the splash screen to make sure its ready before. No code here so I am only guessing at what you have. We have a MainApplication class that is starts up koin first before all else. We have a splash that then waits for specific APIs to come back with data before we start mainactivity.