Gradle Maven deploy failing with 422 Unprocessable Entity

Hi,
we use Github Packages for deploying our Kotlin Multiplatform library to a private repo. Recently, I’ve been having trouble publishing a new version, the Gradle publish task fails with:

Execution failed for task ':coreMechanics:publishAndroidDebugPublicationToGithubPackagesRepository'.
> Failed to publish publication 'androidDebug' to repository 'GithubPackages'
   > Could not PUT 'https://maven.pkg.github.com/fireballrpg/fireball-multiplatform/fireball/coreMechanics-android-debug/1.6.4/coreMechanics-android-debug-1.6.4.aar'. Received status code 422 from server: Unprocessable Entity

I have tried the following, all of these resulted in the same error:

  • Verified that the problem isn’t specific to one package (the task publishes multiple artifacts automatically generated by Gradle)
  • Tried rolling back changes from the new version and publishing the previous version (1.6.3) as 1.6.4
  • Tried publishing the new version as the previous one (1.6.3) - which, IIRC, was previously failing with something like “can’t publish a new package with an existing version”
  • Tried using different versions - 1.4.0-rc0, 1.6.5, 1.7.0

This may be related to


although I haven’t managed to make any use of it for my case and also it seems to be resolved.

The last time I verified this was working was September 30.

POM of the failing package:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <!-- This module was also published with a richer model, Gradle metadata,  -->
  <!-- which should be used instead. Do not delete the following line which  -->
  <!-- is to indicate to Gradle or any Gradle module metadata file consumer  -->
  <!-- that they should prefer consuming it instead. -->
  <!-- do_not_remove: published-with-gradle-metadata -->
  <modelVersion>4.0.0</modelVersion>
  <groupId>fireball</groupId>
  <artifactId>coreMechanics-android-debug</artifactId>
  <version>1.6.4</version>
  <packaging>aar</packaging>
  <dependencies>
    <dependency>
      <groupId>com.squareup.sqldelight</groupId>
      <artifactId>runtime-jvm</artifactId>
      <version>1.3.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.jetbrains.kotlin</groupId>
      <artifactId>kotlin-stdlib-common</artifactId>
      <version>1.3.72</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>com.github.aakira</groupId>
      <artifactId>napier</artifactId>
      <version>1.3.0</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.jetbrains.kotlinx</groupId>
      <artifactId>kotlinx-serialization-runtime-common</artifactId>
      <version>0.20.0</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.kodein.di</groupId>
      <artifactId>kodein-di-erased-jvm</artifactId>
      <version>6.5.5</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.jetbrains.kotlinx</groupId>
      <artifactId>kotlinx-coroutines-core-common</artifactId>
      <version>1.3.5-native-mt</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>com.squareup.sqldelight</groupId>
      <artifactId>coroutines-extensions-jvm</artifactId>
      <version>1.3.0</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>co.touchlab</groupId>
      <artifactId>stately-common-jvm</artifactId>
      <version>1.0.2</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.jetbrains.kotlin</groupId>
      <artifactId>kotlin-stdlib</artifactId>
      <version>1.3.72</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>com.github.aakira</groupId>
      <artifactId>napier-android</artifactId>
      <version>1.3.0</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.jetbrains.kotlinx</groupId>
      <artifactId>kotlinx-serialization-runtime</artifactId>
      <version>0.20.0</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>com.squareup.sqldelight</groupId>
      <artifactId>android-driver</artifactId>
      <version>1.3.0</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.jetbrains.kotlinx</groupId>
      <artifactId>kotlinx-coroutines-android</artifactId>
      <version>1.3.5-native-mt</version>
      <scope>runtime</scope>
    </dependency>
  </dependencies>
</project>

Let me know if I can provide any more info and thanks a lot in advance for any help.

2 Likes

Seeing the same issue:

artifacId should be lowercase to be able to push to github packages

Going to try it, but not sure if this is the solution as the previous packages were published with this artifactId just fine. Thanks anyway, going to update once I try it.

Okay, so it went through when I changed the artifactId.
Not sure why it was working previously and suddenly stopped, anyway it is a solution so thanks a lot!