PHONEGAP Packaging and error resolution for Android development

Source: Internet
Author: User


After I installed and configured all the dependencies on the PhoneGap project, I tried to execute

$ Cordova Run Android

command, the following error occurred.


Error:/home/sam/front/redwine/platforms/android/cordova/run:command failed with exit code 8
At Childprocess.whendone (/usr/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js : 135:23)
At ChildProcess.EventEmitter.emit (events.js:98:17)
At Maybeclose (child_process.js:743:16)
At Process.childprocess._handle.onexit (child_process.js:810:5)
View Rawphonegaperror hosted With❤by GitHub
Cordova build Android or Cordova emulate Android is the same result.


But actually the real problem in the above lines:

[AAPT] (Skipping file '. Jshintrc ' due to android_aapt_ignore pattern '. * ')
[AAPT] (Skipping file '. Bower.json ' due to android_aapt_ignore pattern '. * ')
[AAPT] (Skipping file '. Directory ' due to Android_aapt_ignore pattern '. * ')
[AAPT] Unable to add '/home/sam/front/redwine/platforms/android/assets/www/bower_components/jquery-mobile/node_modules/ Grunt-bowercopy/node_modules/bower/node_modules/semver/semver.browser.js.gz ': File already in archive (try '-u '?)
[AAPT] Error:unable to process assets while packaging '/HOME/SAM/FRONT/REDWINE/PLATFORMS/ANDROID/ANT-BUILD/WINE.AP_ '
[AAPT] Error:packaging of '/HOME/SAM/FRONT/REDWINE/PLATFORMS/ANDROID/ANT-BUILD/WINE.AP_ ' failed

Build FAILED
/home/sam/bin/android-sdk-linux/tools/ant/build.xml:932:the following error occurred while executing this line:
/home/sam/bin/android-sdk-linux/tools/ant/build.xml:950:null returned:1
View RawphonegapError2 hosted With❤by GitHub

This is because there are multiple node_modules directories under the project that are repeatedly packaged with the command failed with exit code 8 issues.


The solution is to modify the Platforms/android/build.xml:

<property name= "Aapt.ignore.assets" value= "&lt;dir&gt;node_*"/>

If you exclude the Node_modules directory, you can perform the Cordova command normally.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.