This project is a minimal Android repro for the Koin regression tracked in InsertKoinIO/koin#2379.
The app creates:
- an
activityRetainedScope - a
scopedScopedConnector - a root
viewModelOf(::MainViewModel) - a short factory chain:
MainViewModel -> ScannerAutoConnectAndConfigureRangeUseCase -> ScannerAutoConnectUseCase -> ScannerInteractor -> ScopedConnector
MainActivity resolves the ViewModel with by viewModel() from an AndroidScopeComponent activity that owns the retained scope.
This repo defaults to 4.2.0 in gradle/libs.versions.toml.
Expected result after launching the app:
- the app crashes during startup
- the top cause is a
NoDefinitionFoundException - Koin reports that
ScopedConnectoris being resolved on_root_
Change only this line in gradle/libs.versions.toml:
koin = "4.1.1"Expected result after rebuilding and launching:
- no crash
- the screen shows
Scoped dependency resolved from activityRetainedScope.
Change the same line to:
koin = "4.2.1-RC1"Expected result after rebuilding and launching:
- crash again during startup
- same class of failure as
4.2.0
- No code changes are required between versions; only the Koin version changes.