admin管理员组

文章数量:1391955

I'm starting a KMP project using native UI's (Compose and Swift UI) and want it to control the shared module version independently by platform.

The project was created with the KMP Wizard.

When some changes are applied to the shared module code, I want to be able to select different versions for Android and iOS. Example:

  • Android using shared module v1.4.5 (already implemented the updates at ComposeApp)
  • iOS using shared module v1.4.0 (still need to implement the UI updates)

I thought about using the shared module published local using mavenLocal().

After setup the shared module, published to the .m2/repository folder (./gradlew publishToMavenLocal ), the module is not found in the dependencies.

Idk if it is the best way to do it.

/shared/build.gradle.kts

plugins {
  alias(libs.plugins.kotlinMultiplatform)
  alias(libs.plugins.androidLibrary)
  id("maven-publish")
}

group = "com.example.project"
version = "1.0.0"

publishing {
    repositories {
       mavenLocal()
   }
}

settings.gradle.kts

  • Added the mavenLocal() repositories

/composeApp/build.gradle.kts

commonMain.dependencies {
   . . .
   // implementation(projects.shared)
   implementation("com.example.project:shared:1.0.0") // Not found
}

本文标签: androidKMP project using shared module with maven local Shared module not foundStack Overflow