Triple-T / gradle-play-publisher

GPP is Android's unofficial release automation Gradle Plugin. It can do anything from building, uploading, and then promoting your App Bundle or APK to publishing app listings and other metadata.
MIT License
4.13k stars 341 forks source link

File too large failure after from 2.2.1 upgrading to 2.8.1 #891

Closed GC-Xi closed 3 years ago

GC-Xi commented 3 years ago

Describe the bug

We are getting the following error after upgrading from 2.2.1 to 2.8.1

Uploading mapping file: 65% complete
Uploading mapping file: 97% complete
Mapping file upload complete
> Task :app:publishReleaseApk FAILED
> Task :commitEditForComDotGcDotTeammanager
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:publishReleaseApk'.
> A failure occurred while executing com.github.triplet.gradle.play.tasks.PublishApk$Processor
   > There was a failure while executing work items
      > A failure occurred while executing com.github.triplet.gradle.play.tasks.PublishApk$ApkUploader
         > 400 Bad Request
           PUT https://www.googleapis.com/upload/androidpublisher/v3/applications/com.gc.teammanager/edits/17617435137012489094/apks?uploadType=resumable&upload_id=ABg5-Uz2uePpe82krgsycTtmC-yx3hVY-gE310RzfUgXEIE8ulVBuxYSB2a-R8wSFdWfd-msJYomlDE04kJI6G2yDzE
           {
             "code" : 400,
             "errors" : [ {
               "domain" : "global",
               "message" : "APK of size 214539916 is too large.",
               "reason" : "badRequest"
             } ],
             "message" : "APK of size 214539916 is too large.",
             "status" : "INVALID_ARGUMENT"
           }

Versions

2.8.1

We are trying to reduce the APK size. Meanwhile, 2.2.1 is preventing us to update to latest gradle. Is there a work around for now?

SUPERCILEX commented 3 years ago

I can't control what the api does, though I'm not sure why it would change between versions. The best I can offer is to make sure you're doing things to minimize app size since 200 megs seems a little high: proguard, remove unused dependencies, download non-critical assets at runtime, use the android app bundle, etc.

SUPERCILEX commented 3 years ago

BTW, the support page says you should only be allowed 100 megs, so I'm not sure what's going on: https://support.google.com/googleplay/android-developer/answer/2481797?hl=en

GC-Xi commented 3 years ago

Thank you