Upon upgrading to Koin Annotations 1.4, I get ```T...
# koin
j
Upon upgrading to Koin Annotations 1.4, I get
Copy code
Type org.koin.ksp.generated.KoinDefAndroidxLifecycleDefaultLifecycleObserver is defined multiple times
I see that in two modules'
KoinMeta-[number].txt
files there's indeed this line twice:
public class KoinDefAndroidxLifecycleDefaultLifecycleObserver
But now what? When I run
gradlew :app:dependencies
I see that everything is using (or bumped to) Lifecycle 2.8.7.
1
Copy code
Type org.koin.ksp.generated.KoinDefAndroidxLifecycleDefaultLifecycleObserver is defined multiple times: H:\Ras BV\notes\component\purchases\build\.transforms\dbeaa89d56d413b01fe6de19a6cb2af2\transformed\bundleLibRuntimeToDirDebug\bundleLibRuntimeToDirDebug_dex\org\koin\ksp\generated\KoinDefAndroidxLifecycleDefaultLifecycleObserver.dex, H:\Ras BV\notes\component\security\build\.transforms\8e22201e3ee8b0193d459c405b136be2\transformed\bundleLibRuntimeToDirDebug\bundleLibRuntimeToDirDebug_dex\org\koin\ksp\generated\KoinDefAndroidxLifecycleDefaultLifecycleObserver.dex
The other definitions are all unique from each other
I figured the trigger for the bug is two different classes binding the same library interface, so I was able to fix the issue by not making the classes
A
and
B
have the observer internally instead of exposed as a type. (Something like this:
private val observer = object : DefaultLifecycleObserver { /** Code here. */ }
). I updated the issue with this workaround/fix (it's nicer to not unnecessarily expose that interface anyway).
👍 1