我在Ubuntu上,我安装了cordova,cordova cli,android studio和所有软件包但是当我尝试构建我的应用程序时,我发现了以下错误:
Running command: /home/admin/Desktop/hello/platforms/android/cordova/build
[Error: Please install Android target: "android-21".
Hint: Open the SDK manager by running: /opt/android-sdk/tools/android
You will require:
1. "SDK Platform" for android-21
2. "Android SDK Platform-tools (latest)
3. "Android SDK Build-tools" (latest)]
ERROR building one of the platforms: Error: /home/admin/Desktop/hello/platforms/android/cordova/build: Command failed with exit code 2
You may not have the required environment or OS to build this project
Error: /home/admin/Desktop/hello/platforms/android/cordova/build: Command failed with exit code 2
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Process.ChildProcess._handle.onexit (child_process.js:810:5)
注意:我在bashrc中添加了android-sdk的路径:
#AndroidDev PATH
export PATH=${PATH}:${HOME}/android-sdk-linux/tools
export PATH=${PATH}:${HOME}/android-sdk-linux/platform-tools
答案 0 :(得分:2)
你有这个问题吧! https://stackoverflow.com/questions/29062330/error-install-android-target-cordova-cli
更新SDK tools
& Android SDK中的“SDK构建”工具。使用Eclipse ADT,它看起来像这个图像
安装21软件包,因为您的cordova版本需要软件包21