Marcel
11/27/2024, 10:31 AM> Task :umbrella:linkDebugFrameworkIosSimulatorArm64 FAILED
e: Compilation failed: IrPropertySymbolImpl is already bound. Signature: org.koin.ksp.generated/_defaultModule|{}_defaultModule[0]. Owner: PROPERTY name:_defaultModule visibility:public modality:FINAL [val]
* Source files:
* Compiler version: 2.0.21
* Output kind: FRAMEWORK
e: java.lang.IllegalStateException: IrPropertySymbolImpl is already bound. Signature: org.koin.ksp.generated/_defaultModule|{}_defaultModule[0]. Owner: PROPERTY name:_defaultModule visibility:public modality:FINAL [val]
at org.jetbrains.kotlin.ir.symbols.impl.IrSymbolBase.bind(IrSymbolImpl.kt:67)
at org.jetbrains.kotlin.ir.declarations.impl.IrPropertyImpl.<init>(IrPropertyImpl.kt:63)
at org.jetbrains.kotlin.ir.declarations.IrFactory.createProperty(IrFactory.kt:299)
at org.jetbrains.kotlin.ir.declarations.IrFactory.createProperty$default(IrFactory.kt:282)
at org.jetbrains.kotlin.backend.common.serialization.IrDeclarationDeserializer.deserializeIrProperty$lambda$76$lambda$70(IrDeclarationDeserializer.kt:737)
at org.jetbrains.kotlin.ir.util.SymbolTable.declareProperty(SymbolTable.kt:800)
at org.jetbrains.kotlin.backend.common.serialization.IrDeclarationDeserializer.deserializeIrProperty(IrDeclarationDeserializer.kt:735)
at org.jetbrains.kotlin.backend.common.serialization.IrDeclarationDeserializer.deserializeDeclaration(IrDeclarationDeserializer.kt:800)
at org.jetbrains.kotlin.backend.common.serialization.IrDeclarationDeserializer.deserializeDeclaration$default(IrDeclarationDeserializer.kt:793)
at org.jetbrains.kotlin.backend.common.serialization.IrFileDeserializer.deserializeDeclaration(IrFileDeserializer.kt:41)
at org.jetbrains.kotlin.backend.common.serialization.FileDeserializationState.deserializeAllFileReachableTopLevel(IrFileDeserializer.kt:141)
...
I'm trying to figure out what have I changed in my last few commits that may have caused this, because this used to work just fine... But sharing in case anyone has any quick idea!Marcel
11/27/2024, 10:32 AMkoin = "4.0.0"
koinKsp = "1.4.0"
However I have tried with the newer beta versions and it does not resolve the issueMarcel
11/27/2024, 10:33 AMMarcel
11/27/2024, 12:21 PMarnaud.giuliani
11/27/2024, 1:17 PMarnaud.giuliani
11/27/2024, 1:18 PMMarcel
11/28/2024, 8:24 AMkoin = "4.0.0"
koinKsp = "2.0.0-Beta1"
kotlin = "2.0.20"
ksp = "2.0.20-1.0.25"
arnaud.giuliani
11/28/2024, 8:33 AMMarcel
11/28/2024, 8:42 AMMarcel
11/28/2024, 10:15 AMMarcel
11/28/2024, 10:20 AM:core:datasource
) but I had not created a new explicit Koin module for the dependencies of that module. I have seen that it's not always required to do so, and only adding the annotations @Single or @Factory on those classes that I want to be injected does the trick (which it does on Android).
However, for this one in particular, the iOS build was broken.
@arnaud.giuliani should I always create specific Koin modules for all of the project modules?
This is how the Module looks like:
@Module
@ComponentScan("com.random.app.datasource")
class DataSourceModule
arnaud.giuliani
11/28/2024, 3:08 PMThomas Richtsfeld
03/14/2025, 12:02 PMarg("KOIN_DEFAULT_MODULE","false")
I was not able to find out the purpose of the default modules as I am quite new to Koin, but didn't run into any issues after removing it.
What I am trying to achieve is to create only one Koin Module that is annotated with ComponentScan
. We are using KMP and have a bunch of gradle modules that are provided via one umbrella module for iOS.
I put the "scan" module into the umbrella module and was able to scan all the sub projects successfully. I hope this is the right approach. I wanted to avoid creating a Koin Module for each Gradle Module.
/**
* Helper function to scan all annotated modules and provide them via Koin
* TODO check if this is the better approach or if each module should expose it's own module
*/
fun scannedModules() = listOf(GlobalComponentScanModule().module)
@Module
@ComponentScan("com.company.shared")
public class GlobalComponentScanModule
@arnaud.giuliani is this approach a way to go without creating a module for each gradle module or does it bloat up at some point?arnaud.giuliani
03/17/2025, 1:58 PMThomas Richtsfeld
03/17/2025, 2:49 PMarnaud.giuliani
03/17/2025, 3:31 PMarnaud.giuliani
03/17/2025, 3:31 PM