突破Flutter私有化仓库100M限制-Hosted packages must be smaller than 100 MB
关于如何创建私有化Flutter仓库、发布Flutter私有化仓库请看这里。
Flutter私有化仓库创建、发布.
私有化仓库大小超过100M报错
如果个人创建的Flutter私有库大小超过100M,在使用pub publish发布私有化仓库过程中就会出现Your package is 602.9 MB. Hosted packages must be smaller than 100 MB
Package validation found the following error:
* Your package is 602.9 MB. Hosted packages must be smaller than 100 MB.
Package validation found the following potential issue:
* Your pubspec.yaml includes an "author" section which is no longer used and may be removed.
errors:[Your package is 602.9 MB. Hosted packages must be smaller than 100 MB.]
Sorry, your package is missing a requirement and can't be published yet.
For more information, see: https://dart.dev/tools/pub/cmd/pub-lish.
查找问题所在
根据报错在pub-SDK-2.10.0-64.0.dev中lib/src/validator/目录下找到size.dart文件,可以看到:
/// The maximum size of the package to upload (100 MB).
const _MAX_SIZE = 100 * 1024 * 1024;
查找到这里,就等于看到了症结所在。
只需要修改_MAX_SIZE的大小就可以突破私有仓库100M的大小限制。
|