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

spierce7

09/25/2019, 9:54 PM
It appears that using the multiplatform plugin to publish a maven release with an Android target doesn’t release the Android library. Does anyone have a good example of how to do this along side multiplatform?
s

spierce7

09/25/2019, 10:05 PM
wow. you are amazing. Thank you.
This is odd:
Copy code
> Failed to notify project evaluation listener.
   > Kotlin target 'android' tried to set up publishing for Android build variants that are not library variants or do not exist:
     * release
     Check the 'publishLibraryVariants' property, it should point to existing Android library variants. Publishing of application and test variants is not supported.
   > Kotlin target 'android' tried to set up publishing for Android build variants that are not library variants or do not exist:
     * release
     Check the 'publishLibraryVariants' property, it should point to existing Android library variants. Publishing of application and test variants is not supported
the release variant does exist though, and it’s an android library
a

adam-mcneilly

09/26/2019, 4:26 AM
omg I was having this problem ALL day! I was going to post the lib I was testing to GitHub and see if anyone here had any clues. Were you able to get this to work, Scott?
s

spierce7

09/26/2019, 4:40 AM
yes I was
Currently using
Copy code
kotlin {
  android {
    publishAllLibraryVariants()
  }
it’s releasing / uploading it. I’m currently having an issue though that it can’t be resolved. trying to work that out now.
interesting. switching to android studio fixes that. Now it can be resolved
a

adam-mcneilly

09/26/2019, 4:58 AM
Switching what to Android Studio? Opening the MPP?
s

spierce7

09/26/2019, 4:59 AM
it temporarily resolved it then I started seeing the issue again
I just fixed it though by importing the library into the common source only
importing the android target libs explicitly was causing errors, but just importing the common library through the common source set seems to work just fine, and it automagically pulls in the android targets
l

louiscad

09/26/2019, 5:42 AM
The docs talk about an option to group the variants by flavor. Using it should help and no longer require you to add the common dependency.
s

spierce7

09/26/2019, 5:55 AM
I’m not sure I understand how that helps. I don’t have any flavors for the library. Also - currently I’m ONLY adding the common dependency and it automatically imports the targets, is that not how it’s supposed to work?
l

louiscad

09/26/2019, 7:10 AM
@spierce7 Then you have default flavor, and debug and release variants would be grouped in the same artifact
17 Views