kevindmoore
08/30/2021, 5:49 PMkevindmoore
08/30/2021, 5:49 PMScott Kruse
08/30/2021, 7:04 PMkevindmoore
08/30/2021, 9:30 PMException: org.koin.core.error.NoBeanDefFoundException
Ex. Message: No definition found for class:'com.intuit.payments.billpay.paymentscard.PaymentsCardViewModel'. Check your definitions!
Thread: Thread[main,5,main]
Memory Usage: 22 / 1812 MB (1%)
Original stack trace:
======================
java.lang.RuntimeException : java.lang.reflect.InvocationTargetException
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:504)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)
Caused by: org.koin.core.error.NoBeanDefFoundException : No definition found for class:'com.intuit.payments.billpay.paymentscard.PaymentsCardViewModel'. Check your definitions!
at org.koin.core.scope.Scope.a(SourceFile:15)
at org.koin.core.scope.Scope.get(SourceFile:7)
at org.koin.androidx.viewmodel.factory.DefaultViewModelFactory.create(SourceFile:1)
at androidx.lifecycle.ViewModelProvider.get(SourceFile:11)
at androidx.lifecycle.ViewModelProvider.get(SourceFile:2)
at org.koin.androidx.viewmodel.ViewModelResolverKt.get(SourceFile:3)
at org.koin.androidx.viewmodel.ViewModelResolverKt.resolveInstance(SourceFile:2)
at org.koin.androidx.viewmodel.scope.ScopeExtKt.getViewModel(SourceFile:10)
at org.koin.androidx.viewmodel.scope.ScopeExtKt.getViewModel(SourceFile:8)
at org.koin.androidx.viewmodel.koin.KoinExtKt.getViewModel(SourceFile:2)
at org.koin.androidx.viewmodel.ext.android.FragmentExtKt.getViewModel(SourceFile:2)
at com.intuit.payments.billpay.paymentscard.PaymentsCardWidget$$special$$inlined$viewModel$2.invoke(SourceFile:2)
at com.intuit.payments.billpay.paymentscard.PaymentsCardWidget$$special$$inlined$viewModel$2.invoke(Unknown Source)
at kotlin.UnsafeLazyImpl.getValue(SourceFile:2)
at com.intuit.payments.billpay.paymentscard.PaymentsCardWidget.b(Unknown Source)
at com.intuit.payments.billpay.paymentscard.PaymentsCardWidget.onViewCreated(SourceFile:5)
at androidx.fragment.app.Fragment.performViewCreated(SourceFile:1)
at androidx.fragment.app.FragmentStateManager.createView(SourceFile:27)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(SourceFile:28)
at androidx.fragment.app.FragmentManager.executeOpsTogether(SourceFile:73)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(SourceFile:10)
at androidx.fragment.app.FragmentManager.execPendingActions(SourceFile:14)
at androidx.fragment.app.FragmentManager.dispatchStateChange(SourceFile:11)
at androidx.fragment.app.FragmentController.dispatchActivityCreated(SourceFile:6)
at androidx.fragment.app.FragmentActivity.onStart(SourceFile:5)
at androidx.appcompat.app.AppCompatActivity.onStart(SourceFile:1)
kevindmoore
08/31/2021, 3:00 PMkevindmoore
08/31/2021, 3:00 PMScott Kruse
08/31/2021, 3:34 PMScott Kruse
08/31/2021, 3:35 PMkevindmoore
08/31/2021, 4:29 PMScott Kruse
08/31/2021, 6:07 PMIt seems like the Fragment gets removed, then a onViewCreated is called. I shut down Koin in onViewDestroyed and then recreate it all in onViewCreated.yeah seems to me your modules are unloaded at some point when they should not be / are required by your view. Im not sure your use case but maybe see if being less aggressive about loading / unloading modules fixes your problem?
kevindmoore
08/31/2021, 6:08 PMScott Kruse
08/31/2021, 6:11 PMScott Kruse
08/31/2021, 6:13 PMkevindmoore
08/31/2021, 6:31 PMkoinApplication
This function loads the modules. One of the modules has a viewModel {} methodarnaud.giuliani
09/01/2021, 7:15 AMarnaud.giuliani
09/01/2021, 7:16 AMkevindmoore
09/01/2021, 4:50 PMarnaud.giuliani
09/02/2021, 7:10 AMarnaud.giuliani
09/02/2021, 7:10 AMloadKoinModules
function that is using the default Koin instance. You need to deal with your Koin instancekevindmoore
09/02/2021, 4:04 PMkevindmoore
09/02/2021, 4:05 PMarnaud.giuliani
09/03/2021, 8:16 AMInside of the KoinApplication I use the modules call to load my modulesstill have issues then? 🤔
kevindmoore
09/03/2021, 5:18 PMarnaud.giuliani
09/06/2021, 7:26 AMkevindmoore
09/07/2021, 1:58 AMarnaud.giuliani
09/07/2021, 6:55 AMkevindmoore
09/07/2021, 4:19 PMkevindmoore
09/09/2021, 9:21 PMarnaud.giuliani
09/13/2021, 9:52 AMarnaud.giuliani
09/13/2021, 9:56 AMarnaud.giuliani
09/13/2021, 1:09 PMkevindmoore
09/13/2021, 4:59 PM