phoengap 4没有建立 - android-studio \ sdk \ platform-tools \ tools \ lib \ build.template

时间:2014-12-13 23:50:08

标签: android cordova

我刚刚从phonegap v3.5.0更新为phonegap v4.0.0,从那时起我创建了一个新项目:

phonegap create jamie
cd jamie
phonegap build android
[phonegap] executing 'cordova platform add android'...
[phonegap] completed 'cordova platform add android'
[phonegap] executing 'cordova build android'...
cp: no such file or directory: C:\var\www\mywarhammer.co.uk\public\app\jamie\icon.png


Running command: C:\var\www\mywarhammer.co.uk\public\app\jamie\platforms\android\cordova\build.bat

Error: ENOENT, no such file or directory 'C:\phonedev\android-studio\sdk\platform-tools\tools\lib\build.template' 
etc.....

Error: C:\var\www\mywarhammer.co.uk\public\app\jamie\platforms\android\cordova\build.bat: Command failed with exit code 8
etc.....

我觉得奇怪/担心的是我已经使用Android SDK Manager运行了所有更新和安装,并知道build.template位于:C:\phonedev\android-studio\sdk\tools\lib\build.template

那么为什么它在错误的位置寻找,我该如何解决这个问题?

2 个答案:

答案 0 :(得分:0)

在我的情况下,node.js生成的蚂蚁是原因。 我用appache替换了一个,直接放在c上 它工作得很好 祝大家好运

答案 1 :(得分:0)

在从v3到v4的更新中,它们已移动到build.template文件所在的位置。

//New location
android-studio/sdk/tools/lib/build.template

//Old Location
android-studio/sdk/platform-tools/tools/lib/build.template

修复

//Broken code inside your path
ANDROID_HOME: C:\phonedev\android-studio\sdk\platform-tool

//Working path - Make sure ANDROID_HOME is pointing to the correct folder
ANDROID_HOME=C:\phonedev\android-studio\sdk //in my case

选自: https://github.com/phonegap/phonegap-cli/issues/507