错误一:
ionic platform add android@版本号 有时候升级过后很多插件不能用
错误二:
trunk1 sudo cordova build android
ANDROID_HOME=/Users/fxp/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home
Reading build config file: /Users/fxp/Desktop/trunk1/build.json
Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK.
Looked here: /Users/fxp/Library/Android/sdk/tools/templates/gradle/wrapper
http://www.androiddevtools.cn下载了SDK Tools,下载解压后,将templates文件夹复制到sdk的tools目录下,再次执行cordova命令就不再报此错误了
错误三:Install the Android build tools version 19.1.0
- Download and install Android SDK for you platform. I'm on Mac so will present instructions from that perspective.
- Go to
Configuration
on login splash screen or Preferences through File or Apple menu. - Go to
Appearance and Behaviour > System Settings > Android SDK
- Observe the
Android SDK Location
. Mine is/Users/me/Library/Android/sdk
- Open
~/.profile
- Add
export ANDROID_HOME=/Users/me/Library/Android/sdk
- Add
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
- Save and
source ~/.profile