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

Benjamin Charais

05/20/2020, 2:27 PM
Morning all, I hope this is a quick one, but googling the right things is kinda tricky since there are similar issues in normal android dependency resolution. I am trying to publish a multiplatform project. Everything seems to be output appropriately to the maven, and I can seemingly resolve all of the targets, except android. No matter what I do it comes back with a similar error, that I haven't been able to figure out. The interesting part, is if I have a non-multiplatform project try to import the android AAR, it works appropriately, so I assume at this point I have some configuration I am missing. I do also have a JVM target that will be pulled in instead of the AAR if I have it active, but I have commented it out until I can resolve this portion, that's a problem for another day. Any info or tips will be greatly appreciated 🙂
As a reference, I'm using Gradle 6.1, and kotlin 1.3.72
r

russhwolf

05/20/2020, 2:32 PM
b

Benjamin Charais

05/20/2020, 2:35 PM
Yes, I've done that. I just had some progress finally, as this is for a production app (Mostly the issue is the conversion to KTS, had working groovy script) I don't want to publish the debug variant, I just added this to the android config, and I was able to resolve the dependency. Is there a way to configure it so that the release binary is the default?
matchinFallbacks
didn't work as I hoped for this.
r

russhwolf

05/20/2020, 2:37 PM
If you don't publish debug, then
matchingFallbacks
has to be specified by the client which is a bit of a pain. I usually just publish all variants to make it easier on consumers
b

Benjamin Charais

05/20/2020, 2:41 PM
Since this is internal, that normally wouldn't be an issue, but that's a bit funky. When I import another multiplatform project, they resolve as
com.soywiz.korlibs:krypto:krypto-android:1.11.1@aar
this makes me believe that the buildType is decided by them? As I am not referencing debug or release?
Or is the plugin trying to do some auto-magic work for us to reference release vs debug with its own controls?
r

russhwolf

05/20/2020, 2:51 PM
The plugin internally tries to pull a library variant that matches the application variant
But I don't know what that looks like in detail
👏 1
b

Benjamin Charais

05/20/2020, 2:52 PM
No problem, it makes sense it's doing that, I appreciate your help in clarifying, for now I can add debug and revisit later 🙂
👍 1