android 平台上的构建模式为“设备”
构建输出:
1> -build-setup: (TaskId:29)
1> [getbuildtools] Using latest Build Tools: 22.0.1 (TaskId:29)
1> [echo] Resolving Build Target for CordovaApp... (TaskId:29)
1> [gettarget] Project Target: Android 4.4.2 (TaskId:29)
1> [gettarget] API level: 19 (TaskId:29)
1> [echo] ---------- (TaskId:29)
1> [echo] Creating output directories if needed... (TaskId:29)
1> [mkdir] Created dir: C:\Egestiona\main\source\cordova sample\bld\Debug\platforms\android\CordovaLib\res (TaskId:29)
1> [mkdir] Created dir: C:\Egestiona\main\source\cordova sample\bld\Debug\platforms\android\CordovaLib\libs (TaskId:29)
1> [mkdir] Created dir: C:\Egestiona\main\source\cordova sample\bld\Debug\platforms\android\CordovaLib\ant-build (TaskId:29)
1> [mkdir] Created dir: C:\Egestiona\main\source\cordova sample\bld\Debug\platforms\android\CordovaLib\ant-build\res (TaskId:29)
1> [mkdir] Created dir: C:\Egestiona\main\source\cordova sample\bld\Debug\platforms\android\CordovaLib\ant-build\rsObj (TaskId:29)
1> [mkdir] Created dir: C:\Egestiona\main\source\cordova sample\bld\Debug\platforms\android\CordovaLib\ant-build\rsLibs (TaskId:29)
1> [mkdir] Created dir: C:\Egestiona\main\source\cordova sample\bld\Debug\platforms\android\CordovaLib\ant-gen (TaskId:29)
1> [mkdir] Created dir: C:\Egestiona\main\source\cordova sample\bld\Debug\platforms\android\CordovaLib\ant-build\classes (TaskId:29)
1> [mkdir] Created dir: C:\Egestiona\main\source\cordova sample\bld\Debug\platforms\android\CordovaLib\ant-build\dexedLibs (TaskId:29)
1> [echo] ---------- (TaskId:29)
1> [echo] Resolving Dependencies for CordovaApp... (TaskId:29)
1> [dependency] Library dependencies: (TaskId:29)
1> [dependency] No Libraries (TaskId:29)
1> [dependency] (TaskId:29)
1> [dependency] ------------------ (TaskId:29)
1> (TaskId:29)
1> -code-gen: (TaskId:29)
1> [mergemanifest] Merging AndroidManifest files into one. (TaskId:29)
1> [mergemanifest] Manifest merger disabled. Using project manifest only. (TaskId:29)
1> [echo] Handling aidl files... (TaskId:29)
1> [aidl] No AIDL files to compile. (TaskId:29)
1> [echo] ---------- (TaskId:29)
1> [echo] Handling RenderScript files... (TaskId:29)
1> [echo] ---------- (TaskId:29)
1> [echo] Handling Resources... (TaskId:29)
1> [aapt] Generating resource IDs... (TaskId:29)
1> (TaskId:29)
1> BUILD FAILED (TaskId:29)
1> C:\Program Files (x86)\Android\android-sdk\tools\ant\build.xml:597: The following error occurred while executing this line: (TaskId:29)
1> C:\Program Files (x86)\Android\android-sdk\tools\ant\build.xml:649: The following error occurred while executing this line: (TaskId:29)
1> C:\Program Files (x86)\Android\android-sdk\tools\ant\build.xml:694: Execute failed: java.io.IOException: Cannot run program "C:\Egestiona\main\source\cordova sample\bld\Debug\platforms\android\CordovaLib\${aapt}" (in directory "C:\Egestiona\main\source\cordova sample\bld\Debug\platforms\android\CordovaLib"): CreateProcess error=2, El sistema no puede encontrar el archivo especificado (TaskId:29)
看起来像\ bld \ Debug \ platforms \ android \ CordovaLib \ $ {aapt}无法解析。
ADT_HOME,ANT_HOME,JAVA_HOME是正确的并且是系统PATH的一部分,我已经将aapt.exe和/ lib从android-sdk \ build-tools(22.0.1)复制到android-sdk \ platform-tools(已经据报道有时工作)
我无法弄清楚这一点,我对这个工具很陌生。这是x86 / x64问题吗? (我在w7x64上。)android 4.4.2和构建工具22.0.1一起使用吗?蚂蚁有问题吗?
我正在解雇我的vs2015RC以进一步试试我的运气,与此同时对vs2013的任何帮助都将不胜感激。
答案 0 :(得分:1)
将其固定为this。基本上,cordova ctp 3.1的工具似乎与Android SDK Tools 24.3.2不兼容。
我downgraded到Android SDK工具24.2,并按特定顺序更新了Android SDK构建工具和Android SDK平台工具到他们的最新版本(分别为22.0.1和22)。
现在我的android构建生成apk就好了。注意cordova的工具仍然会警告你Android SDK构建工具19.1缺失 - 可能安全忽略。