Android studio - Failed to find target android-18
2016-11-02 00:08
507 查看
看了一下国外的解决方案,好多人也都遇到此类问题。看老外的聊天,由衷觉得着实的可爱,同时外国的月亮也不见得比国内的圆。以下是他们的对话(最后有一个小总结):
votes
![](http://static.adzerk.net/Advertisers/321361f9acfd4ead85e0ed564dcfcd7e.png)
![](http://engine.adzerk.net/i.gif?e=eyJhdiI6Mzg5MCwiYXQiOjQsImJ0IjowLCJjbSI6NDkyNjEzLCJjaCI6MTE3OCwiY2siOnt9LCJjciI6MTczODg2NCwiZGkiOiI1NzEzZWNhZjhkNTI0YzJiYTgzMjNiOTJlMjExYmNlYSIsImRtIjoxLCJmYyI6MjA2MzU2NiwiZmwiOjI1MjA3MzgsImlwIjoiMjE4LjIuMjE2LjYiLCJrdyI6ImphdmEsYW5kcm9pZCxncmFkbGUsYW5kcm9pZC1zdHVkaW8iLCJtayI6ImdyYWRsZSIsIm53IjoyMiwicGMiOjYuMzYsImVjIjo2LjM2LCJwciI6NzY1LCJydCI6MiwicmYiOiJodHRwczovL3d3dy5iYWlkdS5jb20vbGluaz91cmw9SGV6bmo2MkgzQ2J3TmpERm52UFRVYkdBakR1X3BNWUVXc24xbVJmLTFfUzQ5LWw1Rm5qeW1qZHR0SVJsajVGOGtCcE1PS2RmY2VwbFV6WFNvdmV6enkxM3lIdEF0VEdheUdURGFoc0JGV3M0cy1JUzUzcWc4eTVkZUN2Q1hoNDVRVHFST1MxM3Z3aUJVS29hUFM3bURfJndkPSZlcWlkPWEyMGM1NjliMDAwMzkwM2UwMDAwMDAwNTU4MThhYTYyIiwic3QiOjgyNzcsInVrIjoidWUxLWJiNjZiNjk1NGYzMDRkMDE4OTNkNTM2NmQxMDA2MGViIiwiem4iOjQ0LCJ0cyI6MTQ3ODAxMTU0MjQ1OSwiYmYiOnRydWUsInBuIjoiYWR6ZXJrMTEzODcwODIzMCIsImZxIjowfQ&s=mg68Hc-q2ttQjRNg0qBlwRbggxk)
。。。。。。。等等
总结:
主要原因在于:你导入项目的编译版本是18,但是你的studio不存在这个版本。
对于万能的解决方案,没有具体的。但是大致两种方案
1:开启sdkmanager 自动选择下载。
2:去网上下载一个sdk-18版本,复制到platforms里面。重启studio即可。
以上两种方案,老外也这么解决的,如果还是不行,另寻高就了~
欢迎关注公众号,每天推送Android技术文章,二维码如下:(可扫描)
I have a problem with Android Studio 0.2.3. 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 the ANDROID_HOMEvariable in the system variables. What seems to be the source of this error? java ![]() androidgradle ![]() android-studio
| |||||||||||||
|
12 Answers
activeoldestvotes
up vote111 down vote accepted | I think you might not have the Android-18 sdk installed. Go to Tools > Android > SDK Manager and check to see if Android 4.3 (API 18) is installed.
| ||||||||||||
|
![](http://static.adzerk.net/Advertisers/321361f9acfd4ead85e0ed564dcfcd7e.png)
![](http://engine.adzerk.net/i.gif?e=eyJhdiI6Mzg5MCwiYXQiOjQsImJ0IjowLCJjbSI6NDkyNjEzLCJjaCI6MTE3OCwiY2siOnt9LCJjciI6MTczODg2NCwiZGkiOiI1NzEzZWNhZjhkNTI0YzJiYTgzMjNiOTJlMjExYmNlYSIsImRtIjoxLCJmYyI6MjA2MzU2NiwiZmwiOjI1MjA3MzgsImlwIjoiMjE4LjIuMjE2LjYiLCJrdyI6ImphdmEsYW5kcm9pZCxncmFkbGUsYW5kcm9pZC1zdHVkaW8iLCJtayI6ImdyYWRsZSIsIm53IjoyMiwicGMiOjYuMzYsImVjIjo2LjM2LCJwciI6NzY1LCJydCI6MiwicmYiOiJodHRwczovL3d3dy5iYWlkdS5jb20vbGluaz91cmw9SGV6bmo2MkgzQ2J3TmpERm52UFRVYkdBakR1X3BNWUVXc24xbVJmLTFfUzQ5LWw1Rm5qeW1qZHR0SVJsajVGOGtCcE1PS2RmY2VwbFV6WFNvdmV6enkxM3lIdEF0VEdheUdURGFoc0JGV3M0cy1JUzUzcWc4eTVkZUN2Q1hoNDVRVHFST1MxM3Z3aUJVS29hUFM3bURfJndkPSZlcWlkPWEyMGM1NjliMDAwMzkwM2UwMDAwMDAwNTU4MThhYTYyIiwic3QiOjgyNzcsInVrIjoidWUxLWJiNjZiNjk1NGYzMDRkMDE4OTNkNTM2NmQxMDA2MGViIiwiem4iOjQ0LCJ0cyI6MTQ3ODAxMTU0MjQ1OSwiYmYiOnRydWUsInBuIjoiYWR6ZXJrMTEzODcwODIzMCIsImZxIjowfQ&s=mg68Hc-q2ttQjRNg0qBlwRbggxk)
up vote45 down vote | I solved the problem by changing the compileSdkVersionin the Gradle.build file from 18 to 17. buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.5.+' } } apply plugin: 'android' repositories { mavenCentral() } android { compileSdkVersion 17 buildToolsVersion "17.0.0" defaultConfig { minSdkVersion 10 targetSdkVersion 18 } } dependencies { compile 'com.android.support:support-v4:13.0.+' }
| ||||||||||||||||||||
|
up vote10 down vote | STEP 1) Start Android SDK ManagerWithandroidcommand something as below, $ /usr/local/android-studio/sdk/tools/android STEP 2) Find API 18![]() STEP 3) Select Android 4.3 (API 18 ) and install packages.
| ||
add a comment |
up vote4 down vote | What worked for me in Android Studio (0.8.1): 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. |
总结:
主要原因在于:你导入项目的编译版本是18,但是你的studio不存在这个版本。
对于万能的解决方案,没有具体的。但是大致两种方案
1:开启sdkmanager 自动选择下载。
2:去网上下载一个sdk-18版本,复制到platforms里面。重启studio即可。
以上两种方案,老外也这么解决的,如果还是不行,另寻高就了~
欢迎关注公众号,每天推送Android技术文章,二维码如下:(可扫描)
相关文章推荐
- Android studio - Failed to find target android-18
- android studio 出现 failed to find target android- 错误解决的办法
- Android Studio 导入项目 出现安装Error:Cause: failed to find target with hash string 'android-23' 等错误
- Android Studio 导入项目 出现安装Error:Cause: failed to find target with hash string 'android-23' 等错误
- Android - "cause failed to find target android-14" 问题
- Android Studio遇到Error:Failed to find: com.android.support:appcompat-v7:21.+
- failed to find target with hash string 'android-23'
- android studio 报错"Failed to find: com.android.support:appcompat-v7:10.+"
- Android studio error : Failed to find target android-X
- android单元测试Test run failed: Unable to find instrumentation target package: com.abc.wallpaper.test
- Failed to find an AVD compatible with target 'Android 4.2.2'
- 有关Android Studio的问题Error:Failed to find: com.google.android.gms:play-services:6.1.71
- 解决Android Studio打开他人包时出现Failed to find: com.android.support:appcompat-v7:21
- Error:Cause: failed to find target : Open Android SDK Manager和SDK对应的API
- android studio Cause:failed to find target with hash string 'android - 17' in...
- Failed to find an AVD compatible with target 'Android 1.5'. Launch aborted.
- Android Studio 报错:Failed to find:com.android.support:appcompat-v7:21.+
- 解决Android Studio打开别人包时出现Failed to find: com.android.support:appcompat-v7:21.
- Android - "cause failed to find target android-14" 问题