InsertKoinIO / koin-annotations

Koin Annotations - About Koin - a pragmatic lightweight dependency injection framework for Kotlin & Kotlin Multiplatform insert-koin.io
https://insert-koin.io
Apache License 2.0
152 stars 40 forks source link

Expect/Actual koin modules break in multi module project #166

Open huibvv opened 2 weeks ago

huibvv commented 2 weeks ago

Using koin annotations in a multi module setup with platform specific koin modules fails to compile with

Expected class KoinNativeModule does not have default constructor

I've added a test project, This project contains an Android app and two separate KMM modules. This links as App -> Shared -> Shared2

Removing the shared2 dependency from the module "shared" will build the app without issues. The IDEA still points out the issue, but it doesn't fail the compilation

image

Expected behavior The compilation should not break, just as it doesn't break if the module is referenced directly by the app module

Koin project used and used version (please complete the following information): koin = "3.6.0-Beta5" koin-compose = "1.2.0-Beta5" koin-annotations = "1.4.0-RC4"

test project.zip

arnaudgiuliani commented 3 days ago

Difference with original project is that your iOS part seems not complete. Seems also the case in KMP-app-Template, but the final generation is not stopped by the error image

Need to check for a second module example

arnaudgiuliani commented 3 days ago

Take a look at https://github.com/InsertKoinIO/KMP-App-Template/tree/second_shared_module

huibvv commented 1 day ago

This way it still is App -> Module right? That structure did not have any issues for me. The issue arose when it has the structure App depends on ModuleA depends on ModuleB.