Build fails with error on task CordovaLib:compileDebugAidl


#1

Hi everyone,
when I try to build the app whith ionic cordova build android and ionic cordova run android the build process fails with the error

Execution failed for task ':CordovaLib:compileDebugAidl'.
> java.lang.IllegalStateException: aidl is missing

Here is my environment (I’m using Bash on windows10):

cli packages: (/usr/lib/node_modules)
    @ionic/cli-utils  : 1.9.2
    ionic (Ionic CLI) : 3.9.2

global packages:
    Cordova CLI : 7.0.1

local packages:
    @ionic/app-scripts : 2.1.4
    Cordova Platforms  : android 6.2.2
    Ionic Framework    : ionic-angular 3.6.1

System:
    Android SDK Tools : 26.0.2
    Node              : v6.11.2
    npm               : 4.2.0
    OS                : Linux 4.4

Build output

ANDROID_HOME=/mnt/c/Users/loren/AppData/Local/Android/sdk
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
Subproject Path: CordovaLib
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
        at build_eg0v6jn07pkb30zbm0ur255t0.run(/mnt/c/Users/loren/WebSiteX5Manager/platforms/android/build.gradle:139)
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
Incremental java compilation is an incubating feature.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.
:preBuild
 UP-TO-DATE
:preDebugBuild UP-TO-DATE
:checkDebugManifest
:preReleaseBuild UP-TO-DATE

:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl
 FAILED


FAILURE: Build failed with an exception.


* What went wrong:
Execution failed for task ':CordovaLib:compileDebugAidl'.
> java.lang.IllegalStateException: aidl is missing

* 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: 1.905 secs
Error: /mnt/c/Users/loren/WebSiteX5Manager/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':CordovaLib:compileDebugAidl'.
> java.lang.IllegalStateException: aidl is missing

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

I’ve tried to remove and readd android platform, I’ve done all the suggested updates on Android Studio, but I’m stuck with this error.
Can someone help me?
Thanks in advance


#2

There is a 6.2.3 available. Try with this one.

There’s a newer version available as well.

What does ionic cordova requirements output?


#3

Hi Sujan12,
thanks for the reply.
I’ve updated cordova Android to 6.2.3 and ionic-cli to 3.10.3
Now my ionic info output is:

cli packages: (/usr/lib/node_modules)
    @ionic/cli-utils  : 1.10.2
    ionic (Ionic CLI) : 3.10.3
global packages:
    Cordova CLI : 7.0.1
local packages:
    @ionic/app-scripts : 2.1.4
    Cordova Platforms  : android 6.2.3
    Ionic Framework    : ionic-angular 3.6.1
System:
    Android SDK Tools : 26.0.2
    Node              : v6.11.2
    npm               : 4.2.0
    OS                : Linux 4.4

If I run ionic cordova requirements I get:

> cordova requirements

Requirements check results for android:

Java JDK: installed 1.8.0
Android SDK: installed true
Android target: not installed
android: Command failed with exit code ENOENT
Gradle: installed /usr/share/gradle/bin/gradle
Error: Some of requirements check failed

I can see ‘Android target: not installed’ : what should I do for fix this issue?
In my config.xml I haven’t specified any preference for ‘android-targetSdkVersion’, I have only
<preference name="android-minSdkVersion" value="19" />

PS: Thank you all for the awesome work on Ionic


#4

Best install Android Studio, this should take care of that.


#5

Hi,
Android studio is already installed and all the SDK are installed, as you can see in the screenshot.

Could be a problem with bash on win10?

Thank you


#6

No idea, sorry. There are two many ways this could be broken.
When ionic cordova requirements is happy, it will work.


#7

Hi,
I’ve resolved my issue, I write here the solution in case someone else will get stuck on the same problem.

The problem was related to windows10’s Bash.

Android Studio was updated, and I’ve installed everything that can be installed :slight_smile:
Than I’ve realized that Window’s Bash is a linux environment and it can’t run .exe files and .bat that are created by Android Studio! (what a dumb)
So I’ve downloaded android-sdk for linux, I’ve updated everything with sdkmanager and now myionic cordova requirements is “happy”:

> cordova requirements

Requirements check results for android:

Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed android-26,android-25

Gradle: installed /usr/share/gradle/bin/gradle