Problem running ionic cordova build android


#1

Every time I tried to run the - ionic cordova build android --verbose, i get this:

[DEBUG] Reason for not using local CLI: LOCAL_CLI_NOT_FOUND
[DEBUG] CLI flags: { interactive: true, confirm: false }

What can I do to solve it? I’ve already verified I had the requirements through ionic cordova requirements and got:

cordova requirements

Requirements check results for android:

Java JDK: installed 1.8.0

Android SDK: installed true
Android target: installed android-27,android-26,android-25,android-23
Gradle: installed /Applications/Android Studio.app/Contents/gradle/gradle-4.1/bin/gradle

Please help me!


#2

Solve what exactly? There is no error.

What is your problem?

What is your ionic info output?


#3

The error it giver when I try to build/run is:

[ERROR] An error occurred while running cordova build android (exit code 1).

My ionic info is:

cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils  : 1.19.0
ionic (Ionic CLI) : 3.19.0

global packages:

cordova (Cordova CLI) : 7.1.0 

local packages:

@ionic/app-scripts : 3.1.5
Cordova Platforms  : android 6.3.0
Ionic Framework    : ionic-angular 3.9.2

System:

ios-deploy : 1.9.2 
Node       : v8.9.3
npm        : 5.5.1 
OS         : macOS High Sierra
Xcode      : Xcode 9.2 Build version 9C40b 

Environment Variables:

ANDROID_HOME : /Development/android-sdk/

Misc:

backend : pro

#4

That is also not the error, but just a part of it. Post the whole output of your build command.


#5

The same error appears when I try to emulate or run on a device, therefore I thought it was this “error” that was causing it. If it is not the culprit, why doesn’t the emulator/mobile phone react to the emulate/run command?

The output:
Running app-scripts build: --platform android --target cordova
[18:19:26] build dev started …
[18:19:26] clean started …
[18:19:26] clean finished in 6 ms
[18:19:26] copy started …
[18:19:26] deeplinks started …
[18:19:26] deeplinks finished in 71 ms
[18:19:26] transpile started …
[18:19:29] transpile finished in 2.58 s
[18:19:29] preprocess started …
[18:19:29] preprocess finished in less than 1 ms
[18:19:29] webpack started …
[18:19:29] copy finished in 2.78 s
[18:19:34] webpack finished in 5.30 s
[18:19:34] sass started …
[18:19:35] sass finished in 1.13 s
[18:19:35] postprocess started …
[18:19:35] postprocess finished in 7 ms
[18:19:35] lint started …
[18:19:35] build dev finished in 9.20 s

cordova build android
ANDROID_HOME=/Users/lauraalpinto/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home
Error: spawn EACCES

[ERROR] An error occurred while running cordova build android (exit code 1).

[18:19:37] lint finished in 1.95 s


#6

I didn’t say you don’t have an error, only that you are not posting the complete error message.

This is the complete error message.

Run the same command with --verbose please. Additional output?

Possibly you can fix this by installing a standalone Gradle:


Also try upgrading to cordova-android 6.4.0.


#7

Thank you, it’s now up and running on my phone! Upgrading to cordova-android 6.4.0 did the trick. Once again, thank you for your time (and patience).