Error creating android application using apache cordova

I installed the cord on linux mint 17.1 xfce, jdk, android and npm in order, and I can create a new cordova application and add the android platform to it:

Cordoba create ... Cordoba platform add android ..

but when I want to build an android, I get an error: Cordoba build ...

Running command: /home/nasser/Desktop/app/app01/platforms/android/cordova/build ANDROID_HOME=/home/nasser/android/sdk JAVA_HOME=/usr/lib/jvm/java-7-openjdk-i386 Running: /home/nasser/Desktop/app/app01/platforms/android/gradlew cdvBuildDebug -b /home/nasser/Desktop/app/app01/platforms/android/build.gradle -Dorg.gradle.daemon=true FAILURE: Build failed with an exception. * Where: Script '/home/nasser/Desktop/app/app01/platforms/android/CordovaLib/cordova.gradle' line: 64 * What went wrong: A problem occurred evaluating root project 'android'. > No installed build tools found. Please install the Android build tools version 19.1.0 or higher. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED Total time: 20.222 secs /home/nasser/Desktop/app/app01/platforms/android/cordova/node_modules/q/q.js:126 throw e; ^ Error code 1 for command: /home/nasser/Desktop/app/app01/platforms/android/gradlew with args: cdvBuildDebug,-b,/home/nasser/Desktop/app/app01/platforms/android/build.gradle,-Dorg.gradle.daemon=true ERROR building one of the platforms: Error: /home/nasser/Desktop/app/app01/platforms/android/cordova/build: Command failed with exit code 8 You may not have the required environment or OS to build this project Error: /home/nasser/Desktop/app/app01/platforms/android/cordova/build: Command failed with exit code 8 at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131: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) 

What can I do?

+7
android cordova
source share
4 answers

Once you have installed sdk android, configured ANDROID_HOME and updated the path, you need to run the android command to actually download the sdk tools and the Android platform.

You do not need to download everything. You can disable system images (save one if you want to use the emulator), samples, android sources, documents and android apis older than API 22 (the latest version of Android version 4 requires api 22).

Not sure if you still need to install ant using android cordova 4, as it seems like they switched to graddle, which installs automatically.

+3
source share

I had the same problem and this solution is to reference the problem:

No installed build tools found. Install tools for building Android version 19.1.0 or higher.

1) You need to go to the android sdk tools folder, for example (in my case). I just wrote a command in the console: $ cd android-sdk-linux/tools

2) In this folder you should write a command

$ ./android list sdk --all and after $ ./android update sdk -u -a -t 20

And it's all!:)

+1
source share

This happened to me because the built-in Android SDK tools were not recognized /.../platforms/android/CordovaLib/cordova.gradle script.

To fix this, I executed "android" and I installed all the build tools, as shown in the image below:

Android SDK Manager

I assume this is sufficient if you install another valid build tool.

Sincerely.

EDIT: Myra Alejandra Rodriguez overtook me. This is another way to do the same;)

0
source share

This will allow you to install all the tools you need, as well as system images that are quite large, restrict them to using the -filter flag

android update sdk --no-ui --all

0
source share

All Articles