Ionic-app-scripts: task ':CordovaLib:compileDebugAidl' fails

Created on 14 Sep 2017  路  6Comments  路  Source: ionic-team/ionic-app-scripts

Short description of the problem:

When I try to build the app, ionic cordova build android and ionic cordova run android fail with the error
```
Execution failed for task ':CordovaLib:compileDebugAidl'.

java.lang.IllegalStateException: aidl is missing

#### What behavior are you expecting?
The app successfully build

**Steps to reproduce:**
1. ionic cordova run android

**Ionic info output**

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'm using Bash on windows10.
    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

Most helpful comment

Hi, the problem is 'caused' by windows 10's bash.
You have to keep in mind that it's a 'Bash on Ubuntu on Windows'... so if you use Android Studio on Win10 for updating all the SDKs and the dev-tools, the bash will not find the binaries (as Android Studio will install .exe binaries! we're on Ubuntu).

So, install the Android command line tools for Linux (https://developer.android.com/studio/index.html#command-tools), which include the sdkmanager, then install all the packages you need and...voil脿!

I felt do dumb when I've realized that... It's nice to see that I'm not the only one who did this mistake :)

All 6 comments

I'm having the exact same problem. Did anyone found a fix? Thank you!

Same here on bash for windows 10.

Hi, the problem is 'caused' by windows 10's bash.
You have to keep in mind that it's a 'Bash on Ubuntu on Windows'... so if you use Android Studio on Win10 for updating all the SDKs and the dev-tools, the bash will not find the binaries (as Android Studio will install .exe binaries! we're on Ubuntu).

So, install the Android command line tools for Linux (https://developer.android.com/studio/index.html#command-tools), which include the sdkmanager, then install all the packages you need and...voil脿!

I felt do dumb when I've realized that... It's nice to see that I'm not the only one who did this mistake :)

Found it myself also few days later haha.

Thanks for the feedbacks

Hey @lurainsin,

I ran into this same error using WSL as well, and installing the android sdk through Linux allowed me to build the .APK file for my project successfully.

However, I can't figure out how to test the build in the emulator through the CLI - how do you test through the emulator since WSL has no GUI? I have been trying to figure out how to run the file through the Windows emulator but have had no luck so far. The only workaround I have found is to drag the .apk file into the Android emulator running in Windows...

Are you using the emulator for Windows or through Linux?

Thanks for any help you can give me on this, I'm quite stuck!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

biesbjerg picture biesbjerg  路  78Comments

jgw96 picture jgw96  路  73Comments

kensodemann picture kensodemann  路  108Comments

chriswep picture chriswep  路  72Comments

Manduro picture Manduro  路  78Comments