E: solved in thread, wasn't Koin specific. `org.k...
# koin
a
E: solved in thread, wasn't Koin specific.
org.koin.core.error.InstanceCreationException: Could not create instance for '[Factory:'com.example.SomethingViewModel']'
I've been getting this recently, but in a very peculiar context: only on a release build, regardless of minification being enabled. On debug — even minified — it works perfectly. I've cleared cache and what not, to no avail. The full error log doesn't reveal anything useful, just call sites. Why is Koin not able to "find" only this ViewModel? All the other ones work, which are very similar in terms of dependencies, what the code does, etc. Other ViewModels are being referenced both before and after this one (in Compose code), and they work without any runtime crashes. Nothing Koin-specific has changed in my code, so I have no idea how to narrow this down. Is there something else release-specific that could affect Koin's functionality here? It worked before; doesn't now. Koin 3.4.3, Compose 1.6.0-alpha04 (not using koin's compose libs though).
Eh, what the hell? Referencing this ViewModel in non-Compose code reveals additional logs that point to Room's DB integrity mismatch (local testing, changed some minor things here and there before releasing). At least I know what the root cause was, but does Compose opaquely swallow exceptions?
a
do you have a clear error message then?
a
Yes, when run in Compose it's only InvocationException, followed by InstanceCreationException and then nothing else. In non-Compose code I get those two, but also the Room data integrity exception after it, which is the real root cause. Don't know why it doesn't show up in Compose; can't be a Koin bug I think.
a
ok 👌
322 Views