Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build a Simple Android App (2014) Getting Started with Android Running the Fun Facts Project

Error message in Android Studio(Windows)

I am getting the following error after running "Fun Facts" program - " Error:Execution failed for task ':app:compileDebugAidl'.

aidl is missing ". I am using Studio 1.2.1.1. How can i fix this ?

7 Answers

Hello,

I think you might be missing either part or all of the Android SDK. Could you go to Tools, Android, SDK Manager and make sure you have Android SDK Tools, Android Build Tools, Android Platform Tools, and the SDK Platform for at least one API(I'd recommend avoiding API 22 for now since that is a preview build). API 21 would be the best for starters. For more information, please check out this page. Please let us know if this does not help or if you need more assistance so we can help you further.

Hi ,

I have updated all the required packages shown in the website but still i am getting the same error. Also i am not getting the "choose device" option after running it.

Could you post your build.gradle files? Also, what API version did you install?

I have API 22(this was already installed), also how will i post "build.gradle" file, sorry i dont have any idea ?

Are you talking about this ----

Information:Gradle tasks [:app:assembleDebug] :app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:checkDebugManifest :app:preReleaseBuild UP-TO-DATE :app:prepareComAndroidSupportAppcompatV72220Library UP-TO-DATE :app:prepareComAndroidSupportSupportV42220Library UP-TO-DATE :app:prepareDebugDependencies :app:compileDebugAidl FAILED Error:Execution failed for task ':app:compileDebugAidl'.

aidl is missing Information:BUILD FAILED Information:Total time: 4.598 secs Information:1 error Information:0 warnings Information:See complete output in console

No, there should be two files called build.gradle in your project files. Open them, copy their contents and paste them here. They should be in a section called Gradle Scripts, if you're in Android View mode.

There was just one file named build.gradle and its content are ------

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:1.2.3'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

allprojects { repositories { jcenter() } }

That's the top level one, there should also be another as well. Depending upon your view, this could be in the app subfolder.

yes you are right there is one more under app ----

apply plugin: 'com.android.application'

android { compileSdkVersion 22 buildToolsVersion "23.0.0 rc1"

defaultConfig {
    applicationId "com.kantimoy.funfacts"
    minSdkVersion 15
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

}

dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:22.2.0' }

I think I know what's happened. Recently, Google released their preview of Android M for developers. This is currently listed as API 22, MNC Preview. I'd recommend installing API 21 and using that for now so there's no confusion in what version you're developing(good enough for learning, but you might need to change things if you release something). You also want to make sure you have build tools 22.0.1 and 21.1.2 installed. Then, you need to change your build.gradle file(the second one you posted) to look more like this:

apply plugin: 'com.android.application'

android { 

compileSdkVersion 21
buildToolsVersion "21.1.2"

defaultConfig {
    applicationId "com.kantimoy.funfacts"
    minSdkVersion 15
    targetSdkVersion 21
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

}

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile 'com.android.support:appcompat-v7:21.1.2' 
}

I believe this should work, but I haven't tested it personally. Please let us know if this does work or if you get any different error messages and we can go from there.