因爲Flutter正式版的發佈,Flutter在國內也變得火熱起來。忽然心血來潮的想寫個Plugin,跟個風蹭一蹭Flutter的熱度,可是奈何國內的一些環境,一直卡在發佈這一步。幾經周折,最後終於發佈成功了!
過程以下:git
首先配置 pubspec.yaml,能夠根據須要,將pubspec補全:github
description: Flutter Easemob SDK
version: 0.0.1
author: kayshen <kayshen_xu@163.com>
homepage: https://github.com/Kayshenxu/hyphenate_plugin
複製代碼
注* 發佈到 Pub上在根目錄須要包含一個LICENSEweb
運行 flutter packages pub publish --dry-run
根據提示修改至終端顯示Package has 0 warnings.
瀏覽器
首先須要根據本身的代理工具給終端設置代理:bash
export http_proxy=http://127.0.0.1:1087;
export https_proxy=http://127.0.0.1:1087;
複製代碼
而後運行flutter packages pub publish
第一次發佈會出現如下受權界面,複製連接到瀏覽器受權便可:工具
Looks great! Are you ready to upload your package (y/n)? y
Pub needs your authorization to upload packages on your behalf.
In a web browser, go to https://accounts.google.com/o/oauth2/auth?*******userinfo.email
Then click "Allow access".
複製代碼
注* ui
Invalid request method
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
複製代碼
必定要在上傳前註釋掉,否則會出現pub finished with exit code 1