1、 weexpack build android 和 weexpack run android 的 區別。javascript
(1)單純打包html
weexpack build android
(2)打包並運行vue
weexpack run android
注:執行時,發現二者都是調起了瀏覽器html5
2、不一樣平臺的打包java
html5平臺:android
(1)打包html5平臺webpack
weexpack build web
這樣你能夠把打包後的資源上傳到cdn服務器,而後上線你的web項目。ios
(2)在 html5 平臺運行web
weexpack run web
Android平臺:npm
(1)打包Android平臺 構建 apk 文件
weexpack build android
(2)在Android平臺運行
weexpack run android
IOS平臺:
(1)打包IOS平臺 構建 ipa 文件
weexpack build ios
(2)在IOS平臺運行
weexpack run ios
3、執行 weexpack build android 遇到的問題
(1)Environment variable $ANDROID_HOME not found !
緣由解析:
沒有配置 環境變量
解決方案:
首先你要知道你的SDK安裝在哪裏,有幾種可能
一、直接從WEB上下載的SDK
ANDROID_HOME= .../ADT/sdk
若是拖拽到了【應用程序】(Applications)目錄下
ANDROID_HOME=~/Applications/ADT/sdk
二、使用Homebrew (brew install android-sdk)下載
ANDROID_HOME=/usr/local/Cellar/android-sdk/{YOUR_SDK_VERSION_NUMBER}
三、 隨Android Studio下載
ANDROID_HOME=/Users/{YOUR_USER_NAME}/Library/Android/sdk
配置
export ANDROID_HOME={YOUR_PATH} #mine: export ANDROID_HOME=/Users/zwwill/Library/Android/sdk export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
或者將以上腳本配置到~/.bash_profile
文件下,若是沒有就新建一個,而後執行
source ~/.bash_profile
注:我的狀況
經過 cmd 查看全部的環境變量
set
配置環境變量
ANDROID_HOME --- D:\Android\Sdk
(2)weex-ui 打包報錯
緣由解析:
沒有找到插件
解決方案:
npm uninstall 之後,從新安裝插件
若是仍是不行,嘗試經過 weex build android 進行打包
修改 webpack.config.js
(3)Explanation for issues of type "ExtraTranslation":
Explanation for issues of type "ExtraTranslation":
If a string appears in a specific language translation file, but there is
no corresponding string in the default locale, then this string is probably
unused. (It's technically possible that your application is only intended
to run in a specific locale, but it's still a good idea to provide a
fallback.).
Note that these strings can lead to crashes if the string is looked up on
any locale not providing a translation, so it's important to clean them
up.
緣由解析:
無用的 字符串 可能致使崩潰,建議清除
解決方案:
文件路徑: \ weexDemo \ platforms \ android \ app \ src \ main \ res \ values-zh-rCN \ strings.xml
刪除便可。
(4)render error:-2013
apk 打包完畢後,運行報錯
緣由解析:
.vue 文件有誤
解決方案:
修改有問題的.vue文件
4、打包成功的狀況
apk 保存路徑
weexDemo\platforms\android\app\build\outputs\apk
5、簽名
// 生成簽名文件 keytool -genkey -alias runan.keystore -keyalg RSA -validity 1000 -keystore runan.keystore // 開始簽名 jarsigner -verbose -keystore runan.keystore -signedjar runan.apk app-release-unsigned.apk runan.keystore
.