When I run my project the build stops and appears message that says:
Gradle: Execution failed for task ':AppName:compileDebugAidl'. > failed to find target android-18
although I have installed the SDK platform of Android 4.3 (API 18) and I tried to reinstall all the SDK. I've also added theANDROID_HOME variable in the system variables.
Settings the ANDROID_HOME variable in my .bash_profile to my Android Studio sdk location (where I downloaded v18) fixed this for me! –
Daniel SmithAug 30 '13 at 16:47
In fact, when I had the problem, the Android-18 sdk was installed, but I think Android Studio didn't detect it. I've resolved by uninstalling and reinstalling SDK and Studio. –
RobertoAV96Sep 29 '13 at 11:04
3
When I received a similar error, just restarting Android Studio was sufficient rather than a complete reinstall. –
Code-ApprenticeFeb 10 at 20:01
1
Restarting the mac was the only thing that let IntelliJ see the newly installed SDKs for me. –
codeulikeFeb 11 at 15:51
good job. I think same would have been accomplished if you advanced your minimum target. In fact, it probly wouldnt run on a 2.3.3 –
Dave AlperovichAug 6 '13 at 16:49
Right click on project name and open Module Settings
Verify SDK Locations
Verify Gradle and Plugin Versions (Review the error message hintsfor the proper version to use)
On the app Module set the Compile SDK Version to android-L (latest)
Set the Build Tools version to largest available value (in my case20.0.0)
These changes via the UI make the equivalent changes represented in other answers but is a better way to proceed because on close, all appropriate files (current and future) will be updated automatically (which is helpful when confronted by the many places where issues can occur).
NB: It is very important to review the Event Log and note that Android Studio provides helpful messages on alternative ways to resolve such issues.