2015-03-13 101 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 

重新啓動您的終端。

相關問題