InsertKoinIO / koin

Koin - a pragmatic lightweight dependency injection framework for Kotlin & Kotlin Multiplatform
https://insert-koin.io
Apache License 2.0
8.76k stars 695 forks source link

getSharedViewModel causes NoBeanDefFoundException after version update in an IsolatedContext #1881

Open goemic opened 1 month ago

goemic commented 1 month ago

Describe the bug I'm trying to update from v3.1.4 to the latest v3.5.6. Unfortunately I'm getting this exception: Caused by: org.koin.core.error.NoBeanDefFoundException: No definition found for type '***..'. Check your Modules configuration and add missing type and/or qualifier!

The problem seems to be the getSharedViewModel() method/behavior which is deprecated - but still should be working. We are using koin with an IsolatedContext in a submodule. For my kotlin class (Fragment) I'm able to switch to the getActivityViewModel() method which works fine. But for my java classes this method is not accessible nor is the deprecated getSharedViewModel() working.

Expected behavior getSharedViewModel() still references to the IsolatedContext or a possibility to access getActivityViewModel() from a java class.

Koin module and version: koin-core:3.5.6 koin-android:3.5.6 koin-android-compat:3.5.6