也許失敗,它可以幫助你在Windows建立與離子的Android
與Android平臺離子/科爾多瓦錯誤生成錯誤安裝螞蟻/離子與後:
%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools;%ANDROID_HOME%\build-tools
開始新謨:離子開始喂空白 - >確定 離子平臺添加機器人 - >確定 離子構建Android - 錯誤:
BUILD FAILED
C:\SDK\android-sdk\tools\ant\build.xml:954: The following error occurred while executing this line:
C:\SDK\android-sdk\tools\ant\build.xml:971: null returned: -1073741819
Total time: 2 seconds
D:\PROD\myapp\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s,/c,ant,debug,-f,D:\PROD\myapp\platforms\android\build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen
ERROR building one of the platforms: Error: D:\PROD\myapp\platforms\android\cordova\build.bat: Command failed with exit code 8
You may not have the required environment or OS to build this project
路徑都OK了,如果我一開始新的科爾多瓦projet(非離子)構建是成功的。
如果我檢查C題:\ Android的SDK \ build.xml文件,然後加
<echo>aapt: ${aapt}</echo>
我可以看到aapt.exe路徑是在Android-21(目標是Android的19)
For me, problem is I have two android sdk : android 19 and android 21. If I use CLI on windows, ionic/cordova choose android-21\aapt.exe by default and no android-19\aapt.exe
I tried to force Path with android version : %ANDROID_HOME%\build-tools\19.0.0 with no success.
To resolve this problem I changed paths to force on aapt executable path to point on android 19: File c:\android-sdk\tools\ant\build.xml :
<aapt executable="C:\android-sdk\build-tools\19.0.0\aapt.exe" ...
</aapt>
這不是最好的方法,但我還沒有找到另一個。