Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build Error running cordova platform add android

I'm trying to create an Android PhoneGap project according to the following link: http://docs.phonegap.com/en/edge/guide_platforms_android_index.md.html

But, when I run the command:

cordova platform add android

I get the following output:

Checking Android requirements...
Creating android project...
[Error: An error occured during creation of android sub-project. Looks like your environment fully supports cordova-android development!
Creating Cordova project for the Android platform:
Path: platforms/android
    Package: com.example.hello
    Name: HelloWorld
    Android target: android-17
Building cordova-3.2.0-rc1.jar

{ [Error: Command failed: 
BUILD FAILED
/path/to/adt/sdk/tools/ant/build.xml:653: The following error occurred while executing this line:
/path/to/adt/sdk/tools/ant/build.xml:698: null returned: 127

Total time: 1 second
] killed: false, code: 1, signal: null }
]

Does anybody know how to get rid of this error?

like image 533
arthursfreire Avatar asked Nov 26 '13 16:11

arthursfreire


2 Answers

For me, on Ubuntu 13.10 64bit, this was fixed by installing 32bit libz:

sudo aptitude install libz1:i386

I found this by:

  • Examining the build.xml and find that it was trying to run aapt
  • Finding aapt in the android-sdk-linux/build-tools/18.1.1/build-tools directory and running it

    libz.so.1 not found

like image 129
kipper Avatar answered Oct 21 '22 12:10

kipper


I have exactly the same error message. in my case, the lib32stdc++ was not installed in my ubuntu, after installation, all work as intended.

sudo apt-get install lib32stdc++6

Hope this could resolve your problem.

like image 36
Darktalker Avatar answered Oct 21 '22 13:10

Darktalker