当我尝试构建Android平台时,我收到了以下错误,当我搜索修复程序时发现了这个solution并通过下载不同的构建工具尝试了相同的但是它没有成功,后来又发生了两次它正常工作的日子(不确定它是怎么回事)我能够执行构建并且在某个时候我又得到了相同的错误。
使用PhoneGap 3.3.0
>phonegap build android
[phonegap] detecting Android SDK environment...
[phonegap] using the local environment
[phonegap] compiling Android...
[error] An error occurred while building the android project.Error executing "ant debug -f "C:\dev\phonegap\web-service\platforms\android\build.xml"": BUILD FAILED
C:\dev\tools\adt-bundle-windows-x86_64-20131030\sdk\tools\ant\build.xml:892: The following error occurred while executing this line:
C:\dev\tools\adt-bundle-windows-x86_64-20131030\sdk\tools\ant\build.xml:894: The following error occurred while executing this line:
C:\dev\tools\adt-bundle-windows-x86_64-20131030\sdk\tools\ant\build.xml:906: The following error occurred while executing this line:
C:\dev\tools\adt-bundle-windows-x86_64-20131030\sdk\tools\ant\build.xml:284: null returned: 1
Total time: 7 seconds
很少出现错误:
>phonegap build android
[phonegap] detecting Android SDK environment...
[phonegap] using the local environment
[phonegap] compiling Android...
[error] An error occurred while building the android project.
如果我再次运行build命令,则会抛出第一个错误。
感谢。
答案 0 :(得分:1)
确保在local.properties文件中正确分配android SDK位置。
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
# location of the SDK. This is only used by Ant
# For customization when using a Version Control System, please read the
# header note.
sdk.dir=/Applications/android-sdk