Pablichjenkov
11/22/2022, 10:52 PMKotlinLeaner
11/24/2022, 6:29 AM@Preview
annotations in my function, but I am getting error on design issues message.
This preview was unable to find a CompositionLocal. You might need to define it so it can render correctly. Show Exception
KotlinLeaner
11/24/2022, 7:00 AMgetViewModel()
or koinViewModel()
in compose function?humblehacker
11/30/2022, 2:34 AMfactory { Service() }
, and I'm attempting to use it in a class as a property declared as val service: Service by inject()
. It works, but it seems that every time I reference that property in my class, Koin creates a new instance. Is that how it's supposed to work? I expected it to construct the Service
lazily, but after that I'd get the same instance until the parent class is destroyed. Changing by inject()
to = get()
gets me the behavior I want, but I really want to know why by inject()
isn't working as I expect.Davide Giuseppe Farella
12/12/2022, 5:29 AM@Module(includes = [...])
class MyAppModule {
// couple of defs here
}
And here’s the first issue: the generated code has syntax issues, like includes(.SomeModule
( note the .
before the name and missing qualifier )
Since in the includes = [...]
I had about 50 modules, I thought I broke the processor, so I grouped them into other modules like
@Module(includes = [A::class, B::class])
class MyAppModule {
// couple of defs here
}
@Module(includes = [...])
class A
@Module(includes = [...])
class B
But seems like A
and B
are not processed, as there is generated code only for MyAppModule
Zach
12/14/2022, 11:42 PMstartKoin
and androidLogger
import org.koin.android.ext.koin.androidContext
import org.koin.android.ext.koin.androidLogger
import org.koin.core.context.startKoin
class MainApplication : Application() {
@Suppress("SpreadOperator")
override fun onCreate() {
super.onCreate()
startKoin {
androidLogger()
androidContext(this@MainApplication)
modules(*allModules)
}
}
}
java.lang.LinkageError: Method void org.koin.android.logger.AndroidLogger.log(org.koin.core.logger.Level, java.lang.String) overrides final method in class Lorg/koin/core/logger/Logger; (declaration of 'org.koin.android.logger.AndroidLogger'
arnaud.giuliani
12/15/2022, 5:33 PMkoin-android
update in 3.3.1
- `koin-androidx-compose`in 3.4.0
https://github.com/InsertKoinIO/koin/blob/main/CHANGELOG.mdarnaud.giuliani
12/15/2022, 5:33 PMkoin-annotations
arnaud.giuliani
12/15/2022, 5:33 PMAgustin Bonilla
12/16/2022, 12:15 AMRobert Jaros
12/16/2022, 6:59 PMkoin-ktor
repository archived? Is this module deprecated? How should we use Ktor with new Koin release?zt
12/18/2022, 11:57 PMEmanuel Moecklin
12/20/2022, 12:56 AMCould not determine the dependencies of task ':feature1:extractDebugAnnotations'.
> Could not create task ':feature1:kspDebugKotlin'.
> Could not create task of type 'KspTaskJvm'.
> org/jetbrains/kotlin/gradle/dsl/KotlinJvmOptionsImpl
Is there a gradle.build.kts example for the setup? https://insert-koin.io/docs/setup/ka_1.0/ only has the Groovy code like
android {
applicationVariants.all { variant ->
variant.sourceSets.java.each {
it.srcDirs += "build/generated/ksp/${variant.name}/kotlin"
}
}
}
holgerbrandl
12/20/2022, 11:31 AMimport org.koin.dsl.koinApplication
import org.koin.dsl.module
data class Tester(val id:String, val created :Long ){
init{
println("creating $this")
}
}
fun main() {
val myModule= module(createdAtStart = true) {
single(createdAtStart = true){
Tester("A", System.nanoTime())
}
}
val koinApplication = koinApplication {}
val koin = koinApplication.koin
koin.loadModules(modules = listOf(myModule))
println("everything loaded?")
println(koin.get<Tester>())
}
The print order changes between the mentioned versions. To me this qualifies as a bug.xxfast
12/22/2022, 5:30 AMPartho Paul
12/28/2022, 1:59 PMProperty delegate must have a 'getValue(Nothing?, KProperty<*>)' method. None of the following functions is suitable: public inline operator fun <T> Lazy<???>.getValue(thisRef: Any?, property: KProperty<*>): ??? defined in kotlin
in this line:
val slackCommandListener by inject<SlackCommandListener>()
My listener is defined in koin as follows:
//in modules.kt
val listenerModule = module {
factory { SlackCommandListener(get(), get()) }
}
//in koin.kt
install(Koin) {
slf4jLogger(level = org.koin.core.logger.Level.ERROR)
modules(serviceModule, controllerModule, listenerModule)
}
Can someone please help?
T.I.A.Big Chungus
12/29/2022, 1:47 PMElio Maroun
12/29/2022, 1:47 PMAdam Brown
01/03/2023, 7:57 PMAdrian Witaszak
01/20/2023, 8:41 AMSeb Jachec
01/23/2023, 3:19 PMsingleOf
declarations in the format below are now unable to be resolved at compile time. How should I be migrating these? I couldn’t seem to find any migration guide or detail of this in the changelog, unless I’ve missed something!
module {
// ...
singleOf { a, b, c -> SomeFactory(a, b, c).build() }
}
// Compiler error:
// None of the following functions can be called with the arguments supplied: ...
// public inline fun <reified R> Module.singleOf(...
// etc ...
Trym Nilsen
01/26/2023, 12:32 PMby activityViewModel<...>()
and i wondered if there is something similar or what i would need to pass to the getViewModel
composable to get the same result.Dan Rusu
01/28/2023, 8:22 PMstartKoin
but libraries don't typically have a main entry point so I'm wondering how to approach DI when creating librariesJames Black
01/29/2023, 2:19 AMCould not create task ':androidApp:compileDebugKotlin'.> Cannot convert the provided notation to a File or URI: [/Users/jamesblack/AndroidStudioProjects/MyPasswordSafe/androidApp/build/generated/ksp/debug/kotlin].
spechard
01/31/2023, 8:48 PMKamilH
02/02/2023, 8:26 AMViewModel
not working correctly with Qualifier
. The issue is described here. Is there any workaround I can apply until it’s resolved?Hossein Amini
02/03/2023, 12:18 PMorg.koin.ksp.generated.module
even in the Koin sample project https://github.com/InsertKoinIO/hello-kmpspechard
02/07/2023, 9:13 PMscope(named<Example>()) {
scoped { params -> Example(name = params.get()) }
}
but how do I resolve the instance in the scope afterwards?
Thanks!Eugen Martynov
02/10/2023, 12:46 PMEugen Martynov
02/10/2023, 12:47 PMEugen Martynov
02/10/2023, 12:47 PMarnaud.giuliani
02/14/2023, 11:02 AMEugen Martynov
02/14/2023, 11:16 AMarnaud.giuliani
02/15/2023, 2:55 PM