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

I got an error

This is what I get when I click "Run" so I can test the emulator

Error:Execution failed for task ':app:preBuild'.

failed to find target android-19 : C:\Users\Emilio\Desktop\Android Studio\android-studio\sdk

1 Answer

Anthony Babich
Anthony Babich
5,505 Points

Hi, do you have the Android-19 SDK installed? Go to Tools > Android > SDK Manager and check to see if Android 4.4 API 19 is installed.

Also check if your build file is set to the correct versions as seen in the example below.

android {
    compileSdkVersion 19
    buildToolsVersion "19.0.0"

    defaultConfig {
        minSdkVersion 10
        targetSdkVersion 19
    }
}