2015-03-13 99 views
-4

你好 我想首先我运行下面的命令来建立与离子和科尔多瓦 混合应用程序,并成功运行 但在运行最后一个命令后,我得到这个错误移动应用与离子

ionic start firtApp 

cd firtApp 

ionic platform add android 

注意:这回我的android-21的错误,我改变了Android的21到Android-18,并运行上述共成功后

ionic build android 

运行mmand我得到这个错误

BUILD FAILED 
D:\New folder\android-sdk-final\android-sdk-fully\sdk\tools\ant\build.xml:601: T 
he following error occurred while executing this line: 
D:\New folder\android-sdk-final\android-sdk-fully\sdk\tools\ant\build.xml:542: U 
nable to resolve project target 'android-21' 

Total time: 1 second 

C:\Users\Mohammad\firstapp\platforms\android\cordova\node_modules\q\q.js:126 
        throw e; 
         ^
Error code 1 for command: cmd with args: /s /c "ant debug -f C:\Users\Mohammad\f 
irstapp\platforms\android\build.xml -Dout.dir=ant-build -Dgen.absolute.dir=ant-g 
en" 
ERROR building one of the platforms: Error: C:\Users\Mohammad\firstapp\platforms 
\android\cordova\build.bat: Command failed with exit code 8 
You may not have the required environment or OS to build this project 
Error: C:\Users\Mohammad\firstapp\platforms\android\cordova\build.bat: Command f 
ailed with exit code 8 
    at ChildProcess.whenDone (C:\Users\Mohammad\AppData\Roaming\npm\node_modules 
\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:131:23) 
    at ChildProcess.emit (events.js:98:17) 
    at maybeClose (child_process.js:756:16) 
    at Process.ChildProcess._handle.onexit (child_process.js:823:5) 

请帮我这个错误 我真的很喜欢 感谢bulid我的网络知识的混合应用。

+0

没有答案???????? – 2015-03-13 07:46:14

回答

0

您没有SDK在您的电脑上正确安装了。 (路径或SDK更新)

这是在错误日志写:您可能没有所需的环境或操作系统来构建这个项目

+0

谢谢,但我有另一个问题 – 2015-03-14 10:56:53

+0

你有什么其他问题? – Initerworker 2015-03-14 12:08:58

+0

感谢您的回答 – 2015-03-14 19:02:16

-2

你只需要安装蚂蚁

sudo apt-get install ant

然后做和以前一样,其正常工作

+1

他使用windows bro .. – 2015-03-16 03:46:53

1

你可以试试这个

到这个目录

C:\Users\Mohammad\.cordova\lib\npm_cache\cordova-android\3.6.4\package\framework 

编辑project.properties文件。将target更改为19

# This file is automatically generated by Android Tools. 
# Do not modify this file -- YOUR CHANGES WILL BE ERASED! 
# 
# This file must be checked in Version Control Systems. 
# 
# To customize properties used by the Ant build system use, 
# "ant.properties", and override values to adapt the script to your 
# project structure. 

# Indicates whether an apk should be generated for each density. 
split.density=false 
# Project target. 
target=android-19 
apk-configurations= 
renderscript.opt.level=O0 
android.library=true 

重新启动您的终端。

相关问题