Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Koin ViewModel annotation is generating a deprecated file after Koin 4.0 #1989

Open
felipezad opened this issue Sep 19, 2024 · 3 comments
Open

Comments

@felipezad
Copy link

felipezad commented Sep 19, 2024

Describe the bug

The generated module with their respective DSL are being generated with a deprecated code.

IRL -> We work with projects that treats warning as errors in projects

To Reproduce
Steps to reproduce the behavior:

  1. setup a project with the latest koin, koin annotations and ksp compiler.
  2. Create a viewmodel with Koin Annotations @KoinViewModel
  3. Inject into MainActivity
  4. Check the Module generated

Expected behavior
The generated module would be generated with the right dsl import org.koin.core.module.dsl.viewModel instead of import org.koin.androidx.viewmodel.dsl.viewModel

image

Koin module and version:

koin = "4.0.0"
koinKsp = "1.3.1"
kspPlugin = "2.0.20-1.0.24"

koinAndroid = { group = "io.insert-koin", name = "koin-android", version.ref = "koin" }
koinAndroidAnnotations = { group = "io.insert-koin", name = "koin-annotations", version.ref = "koinKsp" }
koinKsp = { group = "io.insert-koin", name = "koin-ksp-compiler", version.ref = "koinKsp" }

Snippet or Sample project to help reproduce

Add a snippet or even a small sample project to hel reproduce your case.

Commit -> felipezad/SpotlessApplication@5dff6f5

@GazimSoliev
Copy link

Agree, I have the same issue

@marcelpallares
Copy link

Same issue here

@aezakmi8
Copy link

aezakmi8 commented Oct 3, 2024

Same issue

Kotlin Jetpack Compose

using migration guide didn't fix the problem
https://insert-koin.io/docs/setup/migrate

ksp = "2.0.20-1.0.24"
koin-bom = "4.0.0"
koin-ksp-annotations = "1.4.0-RC4"

koin-bom = { module = "io.insert-koin:koin-bom", version.ref = "koin-bom" }
or
koin-android = { group = "io.insert-koin", name = "koin-android", version.ref = "koin-bom" }
gives same deprecated warning

koin-core-viewmodel = { group = "io.insert-koin", name = "koin-core-viewmodel", version.ref = "koin-bom" }
koin-core-viewmodel-navigation = { group = "io.insert-koin", name = "koin-core-viewmodel-navigation", version.ref = "koin-bom" }

koin-annotations = { group = "io.insert-koin", name = "koin-annotations", version.ref = "koin-ksp-annotations" }
koin-ksp = { group = "io.insert-koin", name = "koin-ksp-compiler", version.ref = "koin-ksp-annotations" }

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants