1

I'm trying to solve this issue: I'm receiving a crash whenever i try to click on a push notification in certain fragment, that would redirect me to another fragment in the app.

I defined my module like this:

scope(named<MainActivity>()) {
            factory<DetailContract.Presenter> { (view: DetailContract.View) ->
                DetailPresenter(
                    view = view,
                    monitoring = get(),
                    api = get(),
                    storage = get(),
                    imageProvider = get()
                )
            }
        }

In my fragment i did this:

private val presenter: DetailContract.Presenter by lazy {
        scope.get {
            parametersOf(this)
        }
    }


override val scope: Scope by fragmentScope()

And in my activity i did like this:

 private val presenter: MainContract.Presenter by inject {
            parametersOf(this)
        }

    override val scope: Scope by activityScope()

However it isn't working even though i'm using activity scope. Before i wasn't using and it didn't work also. Do you guys have any ideas?

This is the crash i'm receiving:

Caused by: org.koin.core.error.NoBeanDefFoundException: |- No definition found for class:'br.example.detail.DetailContract$Presenter'. Check your definitions!
        at org.koin.core.scope.Scope.throwDefinitionNotFound(Scope.kt:304)
        at org.koin.core.scope.Scope.resolveValue(Scope.kt:274)
        at org.koin.core.scope.Scope.resolveInstance(Scope.kt:241)
        at org.koin.core.scope.Scope.get(Scope.kt:204)

Koin version is 3.1.6

0 Answers0