Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/215.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android Cordova构建需要SDK平台_Android_Cordova_Ubuntu - Fatal编程技术网

Android Cordova构建需要SDK平台

Android Cordova构建需要SDK平台,android,cordova,ubuntu,Android,Cordova,Ubuntu,我在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: /o

我在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

你的问题是对的

在Android SDK中更新您的
SDK工具
和“SDK构建”工具。使用EclipseADT,它看起来像这样


安装21软件包,因为您的cordova版本需要21软件包

我不明白,我已经全部安装好了,还有其他建议吗?您是否安装了SDK build tools 21?根据此
请安装Android目标:“Android-21”
它未随SDK一起安装。