Hi, I am trying to test a fragment with roboelectr...
# koin
f
Hi, I am trying to test a fragment with roboelectric and I can’t get rid of an error :
org.koin.core.error.InstanceCreationException: Could not create instance for ... view model
and 3 other defined single<….>{} in the module. In Roboelectric in the @Before I start the Koin with android context and use loadKoinModules(module). I found some answers on stack overflow and I made sure everything is public but with no success. In fragment I am using sharedViewModel if it changes anything.
r
Can you post your module definition and test case code snippet.
f
I played with it a little and now I get
java.lang.RuntimeException: Unable to resolve activity for Intent { act=android.intent.action.MAIN flg=0x10000000 ...test/..Activity } -- see <https://github.com/robolectric/robolectric/pull/4736> for details
( not like I did not check it) but why does such simple test fail? I have an activity (per module) in multi module app so indeed in manifest there is no declaration of activity. Is there an easy work around?