title: Kotlin multiplatform library interface's exposed types not resolved
body: <p>We have a multi-module android project, which we began to refactor to a kotlin-multiplatform project with several modules to share with our iOS app.</p>
  
  <p>Our multiplatform project currently has 4 modules: domain, presentation, data and shared-app. The shared-app module depends on the other three modules and this is the module which is imported into the old android project. We merge the modules into a single one to generate only a single Framework for the iOS project.</p>
  
  <p>Both projects build sucessfully. But if we retrieve an interface instance which is defined in the shared-app module which uses types from the submodules, the IDE shows [ERROR : SomeType] for its return types. </p>
  
  <p><a href="https://i.stack.imgur.com/8PPHR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8PPHR.png" alt="enter image description here"></a></p>
  
  <p>In our old android projects settings.gradle, we used includeBuild(mpp-project) and created a dependency substitution for the shared-app module in the mpp-project.</p>
  
  <pre><code>enableFeaturePreview("GRADLE_METADATA")
  
  includeBuild("mpp-project") {
      dependencySubstitution {
          substitute(module("our.package.name:shared")).with(project(":shared-app"))
      }
  }
  </code></pre>
  
  <p>On the other hand, all of our exposed and transitively imported type can be instantiated in the old android project, even from the submodules. (for example I can instatiate SomeType and it resolves)</p>
  
  <p>Gradle project structure:</p>
  
  <pre><code>oldAndroidRootProject
  ├─myApp (import implementation of all androidModules and mppFramework)
  │  └─build.gradle
  ├─androidModule1
  │  └─build.gradle
  ├─androidModule2
  │  └─build.gradle
  ├─androidModule3
  │  └─build.gradle
  │
  ├─myMppRootProject
  │   ├─mppFramework (depends on mppModuleXs and dependencies are declared as api(":mppModuleX"))
  │   │   └─build.gradle
  │   ├─mppModule1
  │   │   └─build.gradle
  │   ├─mppModule2
  │   │   └─build.gradle
  │   ├─mppModule3
  │   │   └─build.gradle
  │   ├─mppModule4
  │   │   └─build.gradle
  │   ├─build.gradle
  │   └─settings.gradle (uses includeBuild("myMppRootProject"))
  ├─build.gradle
  └─settings.gradle (uses includeBuild("myMppRootProject"))
  
  </code></pre>
  
  <p>If I check the mppFramework modules source, when the androidRoot project was opened I see this:</p>
  
  <p><a href="https://i.stack.imgur.com/ZAyFp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZAyFp.png" alt="enter image description here"></a></p>