4

I am trying to upload my Flutter package to pub.dev. Dry Run work fine no error shown. But When I upload the same package to pub.dev, upload fails with "Uncompressed package archive is too large(size > 104857600).

Any suggestion/solution how to get over it?

General Grievance
  • 4,555
  • 31
  • 31
  • 45
Amit Kalghatgi
  • 357
  • 3
  • 16
  • 1
    can you post your `pub publish -n -v`? – Alann Maulana May 13 '21 at 22:51
  • Do you have an example app inside the package folder ? Try to remove it or just deleting its build folder if it exists! – Gaspard Merten May 17 '21 at 17:25
  • @AlannMaulana when I do pub publish -n -v it says "Package has 0 warnings. " – Amit Kalghatgi May 18 '21 at 05:21
  • Yeah, I know. I'm curious about files that need to published. Maybe you include a binary, video or something big files – Alann Maulana May 18 '21 at 05:37
  • @AlannMaulana I am not able to paste the log here.... We have an SDK which is more than 100 MB... but when we do a dry run... it doesn't give error... it gives error while upload.... – Amit Kalghatgi May 18 '21 at 06:10
  • Acording to [this](https://dart.dev/tools/pub/publishing) : Your package must be less than 100 MB large after gzip compression. If it’s too large, consider splitting it into multiple packages, or cutting down on the number of included resources or examples. – Alann Maulana May 18 '21 at 06:14
  • Yes I have gone through it... but my question is why there is command to test locally like 'pub publish --dry-run' or 'pub publish -n -v' not giving error?. why I am getting error only while uploading? – Amit Kalghatgi May 18 '21 at 06:26
  • Can you drop a link to the package repository in https://github.com/dart-lang/pub/issues/2997 I think we also want to know why your package is so big, and if it needs to be :) – jonasfj May 20 '21 at 08:32

4 Answers4

3

I had this issue recently on updating one of my plugin package. All old versions uploaded properly but this one didnt and there were only minor changes. After some research I found that it was App.framework and Flutter.framework in the examples folder causing the issue. I then ran flutter clean in examples folder and that was it, upload worked. Phew!!

anoop4real
  • 7,598
  • 4
  • 53
  • 56
1

"Your package must be less than 100 MB large after gzip compression. If it’s too large, consider splitting it into multiple packages, or cutting down on the number of included resources or examples."

You can see the official documentation

Subair K
  • 1,760
  • 1
  • 11
  • 31
0

For me, I had created a /examples folder which was taking up too much space. I had no choice but to delete it.

MendelG
  • 14,885
  • 4
  • 25
  • 52
-1

If you have 1 or multiple example projects in your package then just delete the 'build' folder of those example projects before publishing your package.

After deleting 'build' folders from example projects simply run dart pub publish

General Grievance
  • 4,555
  • 31
  • 31
  • 45
Syed Waleed
  • 967
  • 2
  • 5
  • 7