Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Phonegap error android sdk build.xml:950 : null returned: 1

I'm trying to launch phonegap android app in android sdk, but I am receiving an error:

[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 "/Users/me/Projects/one/platforms/android/build.xml"": 
BUILD FAILED
/Applications/Android/adt-bundle-mac-x86_64-20131030/sdk/tools/ant/build.xml:932: The following error occurred while executing this line:
/Applications/Android/adt-bundle-mac-x86_64-20131030/sdk/tools/ant/build.xml:950: null returned: 1

I followed this guide http://docs.phonegap.com/en/2.2.0/guide_getting-started_android_index.md.html but it is not working.

What could have caused this?

like image 736
itsme Avatar asked Dec 20 '13 09:12

itsme


4 Answers

You are most likely also getting the line

invalid resource directory name: /YOUR/PROJECT/ROOT/PATH/bin/res/crunch

right before the error codes, so open up terminal and enter the following:

cd YOUR/PROJECT/ROOT/PATH

rm -fR $(find . -type d -name crunch|xargs)
like image 53
Abandoned Cart Avatar answered Nov 12 '22 22:11

Abandoned Cart


I just had to cd into the platforms/android dir and run ant clean and it fixed this issue for me.

like image 23
jackocnr Avatar answered Nov 12 '22 23:11

jackocnr


had the same issue. something that can help is to read ant log as recommend here

to do so run ant -logfile //antLogFile.txt release -f ./AppMain/build.xml or in the folder itself. i.e : platforms\android run ant -logfile ./antLogFile.txt release

My issue was a file with Hebrew characters on its name..

like image 31
oak Avatar answered Nov 12 '22 22:11

oak


Hi Sorry for the late answer

An alternative to other solutions possibly OS-X Specific but i was having the same issue and none of the solutions for me worked however the mention of assets made me go back and scour over my build logs and i noted this:

[aapt] /Users/rowdoggnz/Development/cordova/surveyapp/platforms/android/assets/www/lib/fa/Icon [aapt] : error: Invalid filename. Unable to add.

This was the cause of my error which shared the same error code and line references as the original poster.

OS-X seems to generate ghost icon files for some reason which are not visible in finder due to being hidden, i used an app called "Invisiblix" to view my project folder and removed all of the 'Icon' files and my app would build fine.

I'm guessing the iOS build naturally ignores these Icon files however Ant doesn't.

Hope this helps someone.

like image 1
Rowan Stewart Avatar answered Nov 12 '22 23:11

Rowan Stewart