AGP has recently created a new "com.android.kotlin.multiplatform.library" plugin. I'll call it the "AGP-KMP" plugin for short here. The "AGP-KMP" plugin is designed to be used instead of the "com.android.library" plugin in KMP libraries with android targets.
In the attached project, there are three sub-projects, all of which are KMP projects (i.e., they all apply the "org.jetbrains.kotlin.multiplatform" plugin):
oldKmpDependency doesn't use the "AGP-KMP" plugin.
oldKmpLib doesn't use the "AGP-KMP" plugin and depends on oldKmpDependency
newKmpLib uses the "AGP-KMP" plugin and depends on oldKmpDependency
Running ./gradlew publish publishes all three sub-projects to the testRepo directory.
The pom file for the oldKmpLib android artifact lists the artifactId for the dependency on oldKmpDependency correctly: <artifactId>oldKmpDependency-android</artifactId>. The pom file is located here: testRepo/com/example/oldKmpLib-android/1.0/oldKmpLib-android-1.0.pom
The problem is that the pom file for the newKmpLib android artifact lists the artifactId for the dependency on oldKmpDependencyincorrectly (it adds a "-debug" at the end): <artifactId>oldKmpDependency-android-debug</artifactId>. The pom file is located here: testRepo/com/example/newKmpLib-android/1.0/newKmpLib-android-1.0.pom
Expected Behavior
The pom file for the newKmpLib android artifact should list the artifactId for the dependency on oldKmpDependency correctly as <artifactId>oldKmpDependency-android</artifactId>.
Context (optional)
The AndroidX team hit this issue when migrating their KMP libraries to the "AGP-KMP" plugin.
Steps to Reproduce
Repro project attached.
Running ./gradlew publish publishes all three sub-projects to the testRepo directory.
Current Behavior
AGP has recently created a new
"com.android.kotlin.multiplatform.library"
plugin. I'll call it the "AGP-KMP" plugin for short here. The "AGP-KMP" plugin is designed to be used instead of the"com.android.library"
plugin in KMP libraries with android targets.In the attached project, there are three sub-projects, all of which are KMP projects (i.e., they all apply the
"org.jetbrains.kotlin.multiplatform"
plugin):oldKmpDependency
doesn't use the "AGP-KMP" plugin.oldKmpLib
doesn't use the "AGP-KMP" plugin and depends onoldKmpDependency
newKmpLib
uses the "AGP-KMP" plugin and depends onoldKmpDependency
Running
./gradlew publish
publishes all three sub-projects to thetestRepo
directory.The pom file for the
oldKmpLib
android artifact lists the artifactId for the dependency onoldKmpDependency
correctly:<artifactId>oldKmpDependency-android</artifactId>
. The pom file is located here:testRepo/com/example/oldKmpLib-android/1.0/oldKmpLib-android-1.0.pom
The problem is that the pom file for the
newKmpLib
android artifact lists the artifactId for the dependency onoldKmpDependency
incorrectly (it adds a "-debug
" at the end):<artifactId>oldKmpDependency-android-debug</artifactId>
. The pom file is located here:testRepo/com/example/newKmpLib-android/1.0/newKmpLib-android-1.0.pom
Expected Behavior
The pom file for the
newKmpLib
android artifact should list the artifactId for the dependency onoldKmpDependency
correctly as<artifactId>oldKmpDependency-android</artifactId>
.Context (optional)
The AndroidX team hit this issue when migrating their KMP libraries to the "AGP-KMP" plugin.
Steps to Reproduce
Repro project attached.
Running
./gradlew publish
publishes all three sub-projects to thetestRepo
directory.Gradle version
8.9
Build scan URL (optional)
No response
Your Environment (optional)
AGP version: 8.7.0-alpha03 Kotlin version: 1.9.24