Build Error running cordova platform add android

2020-03-17 04:29发布

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?

4条回答
乱世女痞
2楼-- · 2020-03-17 04:38

According to my knowledge ,first of all you have to download the cord-ova plugin from cord-ova and after you have to install the plugin eclipse by going to help-->Install new software by typing phone-gap. In eclipse Press Ctrl+N and select phone-gap and while creating the project choose the your cord-ova which you have download give the path up to of cord-ova (there is radio button to choose that ,by default it choose 1.X.X version instead of that choose your latest version below that )

查看更多
家丑人穷心不美
3楼-- · 2020-03-17 04:46

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

查看更多
Ridiculous、
4楼-- · 2020-03-17 04:51

The error is related to Ant. There is no build system.

Download and install Ant.

Make sure you configure the system PATH correctly as defined in the installation document.

查看更多
甜甜的少女心
5楼-- · 2020-03-17 04:55

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.

查看更多
登录 后发表回答