問題描述
Flutter Package:未壓縮的包存檔太大 (Flutter Package : Uncompressed package archive is too large)
我正在嘗試將我的 Flutter 包上傳到 pub.dev。試運行工作正常,沒有顯示錯誤。但是當我將相同的包上傳到 pub.dev 時,上傳失敗並顯示“未壓縮的包存檔太大(大小 > 104857600)。
任何建議/解決方案如何克服它?
參考解法
方法 1:
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!!
方法 2:
"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
方法 3:
For me, I had created a /examples
folder which was taking up too much space. I had no choice but to delete it.
(by Amit Kalghatgi、anoop4real、Subair K、MendelG)