Phonegap 3.3 构建 Android 失败

Kev*_*vin 2 android node.js cordova phonegap-build

我正在尝试构建一个项目,但是当我输入时:cordova build android出现以下错误:

Generating config.xml from defaults
for platform "android"
Preparing android project
Compiling app on platform "android"
via command "../platforms/android/cordova/build"
Error: An error occurred
while building the android project.Error executing "ant debug -f "../platforms/android/build.xml"":BUILD FAILED /usr/local/Cellar/android-sdk/22.3/tools/ant/build.xml:932:The following error occurred
while executing this line: /usr/local/Cellar/android-sdk/22.3/tools/ant/build.xml:950:null returned: 1

Total time: 18 seconds


at ChildProcess. < anonymous > (/usr/local/lib/node_modules/cordova/src/compile.js:65:22)
at ChildProcess.EventEmitter.emit(events.js: 98: 17)
at maybeClose(child_process.js: 735: 16)
at Socket. < anonymous > (child_process.js: 948: 11)
at Socket.EventEmitter.emit(events.js: 95: 17)
at Pipe.close(net.js: 466: 12)
Run Code Online (Sandbox Code Playgroud)

这个问题有解决办法吗?


编辑

我使用 brew 来安装 Android-SDK 并安装了所有可能的构建工具: Android-SDK 位置

我的 android 清单看起来像: 安卓清单

编辑2

根据这里的要求是对以下内容的回应cordova build android --verbosehttp : //pastebin.com/rqdkVKYG

Kev*_*vin 5

我发现了这个错误。

测试时,重新安装android-sdk和ant。我试图创建一个新项目。比在终端中输入,cordova build它完美地构建。在此之后,我将现有的 WWW 文件夹复制到新项目中。键入cordova build再次,它给了一个错误。现在我知道错误在我的 WWW 文件夹中,而不是在项目本身中。扫描我的文件夹,我注意到一个没有扩展名的文件(隐藏文件)。我删除了文件并再次尝试。成功!

总结: 扫描您的文件夹中没有扩展名的文件并删除或移动它们。Cordova 不喜欢这些。


编辑

如果这不起作用,请尝试:

cordova platform rm android

然后使用以下方法重新安装android:

cordova platform add android

现在尝试构建。