Shankar
Shankar

Reputation: 636

PhoneGap - Android build throws error - BUILD FAILED - \ant\build.xml:892

When I try to build Android platform, I was getting the below error and when I searched for fix found this solution and tried the same by downloading different build tools but it didn't worked out and later after two days it worked normally (not sure how it was) and I was able to execute the build and again in sometime I am getting the same error.

Using 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

Rarely below error:

>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.

If I run the build command again it throws the first error.

Thanks.

Upvotes: 1

Views: 3372

Answers (1)

Nurdin
Nurdin

Reputation: 23901

Make sure your android SDK location assign correctly in local.properties file.

# 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

enter image description here

Upvotes: 1

Related Questions