An error occurred in cordova build android? An error occurred while packing the APP.

  android, question

Error: Error code 1 for command: cmd with args: /s,/c,”D:\hello\platforms\android\gradlew cdvBuildDebug -b D:\hello\platforms\android\ build.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true”


There was an error in the packing time, could you tell me where I set up the error?

The message inside is very clear. It says that you lack the necessary environment for packing.

  1. Maybe android’s environment variables are not configured

  2. Android build tools version greater than or equal to 19.1.0 needs to be installed


supplementary information

  1. Hello, android-23 here does not refer to Android SDK Tools but to the api level of android-sdk. For example, your android5.0(API 21) is android-21
    See the following figure for details:

  2. To solve this problem, you can modify the specified version of your existing android project (modify the file). See the following figure for details:

Added on March 4

  1. Android list suggests that the emulator simulator you created earlier cannot be loaded. It is recommended that you delete it before executing this command. (In addition, I recommend a software.GenymotionIt will perform better than the emulator. )

  2. Modify the target version of android, not necessarily according to my screenshot, you need to specify according to the sdk api version that you actually installed. Because I use android studio to modify will automatically refresh the entire project.
    In there is a passage like this:

# To customize properties used by the Ant build system edit
 # "", and override values to adapt the script to your
 # project structure.
If you want to customize the attributes and use ant compilation system, please modify file to overwrite and adjust the attribute values in your project structure.  (The translation is not good, that is, if you do not use IDE, you need to build yourself.)