Questions tagged [koin-scope]
Koin Scope is the Scope feature of Koin
koin-scope
32
questions
0
votes
1
answer
29
views
Koin - using scopes in isloated context when building a library with koin
I am using koin in an SDK, i create an isolated koin context as explained in the docs, however, i want to allow the SDK consumer to turn the SDK off, effectively clearing all classes created by the ...
0
votes
0
answers
128
views
Koin variables initialisation on multi Module project
I am converting my whole project into Koin. Using Koin KMP (I am converting right now my shared module).
And I have multiple modules, that are being executed in one main module (which the main ...
1
vote
0
answers
145
views
How to create scope for parent fragment to use it in children
I have a class TestClass and I want to share its instance between child fragment with using koin scope of parent fragment.
Is it possible to do?
Thanks.
I try:
class TestClass {
fun close() { .... ...
-1
votes
1
answer
37
views
Koin - Creating Implementor for Interface in Andorid
Using koin dependency Injection library in Android. I have doubt in creating interface implementor.
My Interface is as below:
interface EnrollApiInterface {
@GET("person/templates/{id}"...
-2
votes
1
answer
293
views
Koin dependency Injection Isssue - Android
In my android application am using MVVM architecture and using koin library for DI.
Below is my Repository class:
class JaiminRepository constructor(
private var remoteDataSource : ...
-2
votes
1
answer
2k
views
Koin Dependency Injection - org.koin.core.error.NoBeanDefFoundException
Hello I am working on Android app development and in it a koin dependency injection library is integrated. It is something like below:
object Jaimin {
fun initJaimin(
application : ...
0
votes
0
answers
52
views
My ViewModel injection has stopped working
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:641)
at com.android.internal.os....
1
vote
0
answers
722
views
Custom scope with koin and kotlin
I must use Koin to construct a custom scope using "Android Service" in my Android app module. I read other blogs and the Koin documentation; a few of them are below.
Understanding Android ...
0
votes
1
answer
777
views
Refresh auth token in Ktor while using koin
I was using Koin as dependency Injection library to create the ktor HttpClient:
val AppModule = module {
single { provideClientService() }
}
fun provideClientService(preferences: ...
1
vote
0
answers
62
views
NoBeanDefFoundException but scope is already defined
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 ...
0
votes
1
answer
1k
views
Koin. Cannot inject to fragment with ScopeActivity
I'm trying to inject some dependency to both activity and fragment using Koin and I expect it to live as long as activity lives, but it turned out a headache for me.
I managed to create a module that ...
3
votes
1
answer
836
views
Why is Koin scoping feature not working properly?
So scoping with Koin DI seem to throw a weird exception when KoinApplication::checkModules() method is called within a unit test. Here is the full code:
import org.koin.core.KoinApplication
import ...
1
vote
1
answer
1k
views
How to scope a Usecase to a Feature / Activity in Koin
I'm maintaining a large app (mostly) using a "one feature one activity"-architecture.
Now i'd like to scope a usecase, so it lives as long as the activity, something like this:
// koin ...
0
votes
0
answers
215
views
Error while resolving instance for class 'okhttp3.OkHttpClient' - Can't create definition for 'Single'
I am getting below error after merging my code from separate local branch to 'development' branch:
Error while resolving instance for class 'okhttp3.OkHttpClient' - error: org.koin.error....
0
votes
1
answer
2k
views
Scope a viewmodel between 2 fragments with koin 2.2.3 and jetpack navigation
My project is on Koin 2.2.3 and I search to scope a viewModel in function of a graph.
In my ViewModelModule I got this:
val Int.navQualifier: Qualifier
get() = named("FlowQualifier (NavGraphId@$...