gradle-play-publisher: Fail to upload signed APK

Describe the bug

We currently experiencing an issue with uploading signed apk to the Google Play. We use v1 signing. This is our configuration:

play {
  serviceAccountCredentials = file("${rootProject.projectDir}/service.json")
  // specifying dir will just upload things and avoid to build apk locally
  // mapping file should be in the same folder
  artifactDir = file("${apkFolder}")
  track = 'alpha'
}

This error response that we see on our CI:

com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
  {
    "code" : 403,
    "errors" : [ {
      "domain" : "androidpublisher",
      "message" : "APK signature is invalid or does not exist. Error from apksigner: ERROR: JAR_SIG_NO_MANIFEST: Missing META-INF/MANIFEST.MF",
      "reason" : "apkNotificationMessageKeyInvalidSignature"
    } ],
    "message" : "APK signature is invalid or does not exist. Error from apksigner: ERROR: JAR_SIG_NO_MANIFEST: Missing META-INF/MANIFEST.MF"
  }

The strange thing - we can still upload file manually.

How To Reproduce

Run our CI pipeline.

Versions

  • Gradle Play Publisher: 2.2.1
  • Gradle Wrapper: 5.4.1
  • Android Gradle Plugin: 3.4.1

Tasks executed

app:publishProductionApk

Expected behavior

We can upload apk with gradle as we can do it manually.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 16

Most upvoted comments

Congrats with joining Google!

Awesome! 🎉 Some notes about your reply:

  • There’s text at the bottom of this section that says all artifacts in the folder will be uploaded. Not sure if it’s noticeable enough though.
  • The reason I need an artifact folder is because you can upload multiple APKs (think splits) and have that be a valid operation. Also, it supports the mapping file. However, I’ve been annoyed by that too and have sneaked this in for the next release.
  • As for using the name given by AGP, that would kind of defeat the purpose of letting you specify arbitrary artifacts we know nothing about.