Hi! I'm experiencing an issue with `kotlin-inject-...
# kotlin-inject
e
Hi! I'm experiencing an issue with
kotlin-inject-anvil
0.1.6 where
@ContributesBinding
with multibinding across modules works for Android but not iOS. My Setup: • Kotlin
2.2.21
, KSP
2.2.21-2.0.4
, kotlin-inject-anvil
0.1.6
• Multi-module KMP project (see diagram) • Using per-target KSP configuration (
kspAndroid
,
kspIosSimulatorArm64
, etc.) What happens: • Feature modules generate contribution interfaces correctly in
amazon.lastmile.inject
package for both Android and iOS • App module's
MergeComponentProcessor
finds contributions for Android • App module's
MergeComponentProcessor
does NOT find contributions for iOS • Result:
KotlinInjectAppComponentMerged
is empty for iOS (doesn't extend the contribution interfaces) Generated code comparison: Android (works):
Copy code
interface KotlinInjectAppComponentMerged : 
    ComDangerfieldAnteFeaturesActivityImplActivityFeatureEntryPoint,
    ComDangerfieldAnteFeaturesHomeImplHomeFeatureEntryPoint
iOS (broken):
Copy code
interface KotlinInjectAppComponentMerged  // Empty!
The contribution interfaces ARE generated in the feature modules for iOS, but
Resolver.getDeclarationsFromPackage("amazon.lastmile.inject")
appears to not see them when processing the app module. Is this a known limitation with Kotlin 2.2.x/KSP 2.2.x, or is there a specific configuration needed for cross-module contributions in KMP? I noticed the sample uses Kotlin
2.1.21
- Maybe I should downgrade? Thanks!
b
Re: https://kotlinlang.slack.com/archives/C0255B8KX7W/p1763072221070349?thread_ts=1744894927.888399&amp;cid=C0255B8KX7W InjectableThing is missing a provider in this case because you marked it as multibinding. Set<InjectableThing> should resolve
e
oh yeah oops. A bit of copy and paste error
Updating this: We hopped on a call. Couldn't resolve this. Even without the multi bindings it seems the app module could not locate the feature modules generated code for iOS