I’m getting the following two errors when trying t...
# multiplatform
j
I’m getting the following two errors when trying to publish my library to maven :
Copy code
* What went wrong:
A problem was found with the configuration of task ':core:publishIosSimulatorArm64PublicationToSonatypeRepository' (type 'PublishToMavenRepository').
  - Gradle detected a problem with the following location: '/Users/jeantuffier/Repos/statemachine/core/build/libs/core-0.2.0-dev13-javadoc.jar.asc'.
    
    Reason: Task ':core:publishIosSimulatorArm64PublicationToSonatypeRepository' uses this output of task ':core:signIosArm64Publication' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
    
    Possible solutions:
      1. Declare task ':core:signIosArm64Publication' as an input of ':core:publishIosSimulatorArm64PublicationToSonatypeRepository'.
      2. Declare an explicit dependency on ':core:signIosArm64Publication' from ':core:publishIosSimulatorArm64PublicationToSonatypeRepository' using Task#dependsOn.
      3. Declare an explicit dependency on ':core:signIosArm64Publication' from ':core:publishIosSimulatorArm64PublicationToSonatypeRepository' using Task#mustRunAfter.


* What went wrong:
A problem was found with the configuration of task ':core:signIosSimulatorArm64Publication' (type 'Sign').
  - Gradle detected a problem with the following location: '/Users/jeantuffier/Repos/statemachine/core/build/libs/core-0.2.0-dev13-javadoc.jar.asc'.

    Reason: Task ':core:publishIosArm64PublicationToSonatypeRepository' uses this output of task ':core:signIosSimulatorArm64Publication' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.

    Possible solutions:
      1. Declare task ':core:signIosSimulatorArm64Publication' as an input of ':core:publishIosArm64PublicationToSonatypeRepository'.
      2. Declare an explicit dependency on ':core:signIosSimulatorArm64Publication' from ':core:publishIosArm64PublicationToSonatypeRepository' using Task#dependsOn.
      3. Declare an explicit dependency on ':core:signIosSimulatorArm64Publication' from ':core:publishIosArm64PublicationToSonatypeRepository' using Task#mustRunAfter.
Is it possible that there is a bug somewhere that make wrong task matches?
publishIosSimulatorArm64PublicationToSonatypeRepository
should depends on
signIosSimulatorArm64Publication
and not
signIosArm64Publication
as the error suggests. And the opposite for the second error. I can fix it by adding this to my gradle scripts, but it feels wrong.
Copy code
tasks.named("publishIosArm64PublicationToSonatypeRepository") {
    dependsOn(tasks.named("signIosSimulatorArm64Publication"))
}

tasks.named("publishIosSimulatorArm64PublicationToSonatypeRepository") {
    dependsOn(tasks.named("signIosArm64Publication"))
}
a
looks like it might be this issue? https://youtrack.jetbrains.com/issue/KT-46466 try this for a cleaner workaround
Copy code
//region Fix Gradle warning about signing tasks using publishing task outputs without explicit dependencies
// <https://youtrack.jetbrains.com/issue/KT-46466>
tasks.withType<AbstractPublishToMaven>().configureEach {
  val signingTasks = tasks.withType<Sign>()
  mustRunAfter(signingTasks)
}
//endregion
🙌 2
❤️ 1
thank you color 1
j
That worked, thanks!
128 Views