https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
a

ansman

09/25/2019, 1:37 PM
After publishing my MPP library to Artifactory I get this error when building:
Unable to find a matching variant of …
The reason is that I introduced an additional build type in my project which of course doesn’t have a matching one in the MPP project. This doesn’t happen with other MPP projects. Is it because I’ve published both the
debug
and
release
types of my MPP library?
r

russhwolf

09/25/2019, 9:25 PM
Yes, the reason you're seeing this now and didn't see it before is that you were publishing both debug and release. Have you tried
publishAllLibraryVariants()
? I've never used it with custom build types.
a

ansman

09/25/2019, 9:26 PM
The project with 3 build variants isn’t the multi platform project
Ideally I just want to publish the release variant
r

russhwolf

09/25/2019, 9:28 PM
Oh I see. In that case I don't think there's any better option right now.
a

ansman

09/25/2019, 9:29 PM
But how come it doesn’t happen with other MPP projects that only publishes one artifact? Could it be because they don’t publish the Gradle metadata and you depend directly on the Android or jvm artifact?
r

russhwolf

09/25/2019, 9:32 PM
Not sure. I haven't experimented much with custom build types in a multiplatform project. But for my own stuff I now always publish debug and release instead of just release so that consumers with a default setup don't need to do extra work.
a

ansman

09/25/2019, 9:34 PM
Well, it doesn’t matter if you use a custom build type. If you just publish release debug won’t work
r

russhwolf

09/25/2019, 9:35 PM
If the consumer does
matchingFallbacks
it does
a

ansman

09/25/2019, 9:53 PM
Yes, which is the solution I posted in the message after. But that doesn’t fee like a good solution if you publish a public library