When attempting to publish the Android side of a m...
# multiplatform
j
When attempting to publish the Android side of a multiplatform library using
publishLibraryVariants("release")
, I keep getting
org.gradle.api.UnknownDomainObjectException: KotlinJvmAndroidCompilation with name 'release' not found.
. If I attempt to create one manually in the line above using
compilations.create("release")
, it gives
Cannot add a KotlinJvmAndroidCompilation with name 'release' as a KotlinJvmAndroidCompilation with that name already exists.
If I just read the compilations before hand, I can see that there are none. Can anyone help? I've been investigating this for a couple hours now
h
Could you please share a minimal sample that reproduces the issue? I think I need to look into the project structure, targets configuration, and plugins application order; if it's not an open-source project, feel free to remove all sources and external dependencies. You can share it privately by creating an issue at kotl.in/issue and adding an attachment with visibility restricted to
jetbrains-team
.
j
Will do! It actually is open source, but it currently uses a plugin I made to simplify build script stuff, so I'll try to make a minimal example that doesn't need it.
That was insane - turns out it was due to a very strange interaction with the publishing plugin being accessed early, and somehow the errors pointed to Kotlin Multiplatform instead of how publishing was accessed AND it only occurred when using the Android side of Kotlin MPP. Don't worry about this one.