看了一下国外的解决方案,好多人也都遇到此类问题。看老外的聊天,由衷觉得着实的可爱,同时外国的月亮也不见得比国内的圆。以下是他们的对话(最后有一个小总结):
I have a problem with Android Studio 0.2.3. When I run my project the build stops and appears message that says:
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 What seems to be the source of this error? | |||||||||||||
|
12 Answers
111 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. | ||||||||||||
|
45 | I solved the problem by changing the 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.+'} | ||||||||||||||||||||
|
10 | STEP 1) Start Android SDK ManagerWith $ /usr/local/android-studio/sdk/tools/android STEP 2) Find API 18STEP 3) Select Android 4.3 (API 18 ) and install packages. | ||
|
4 | What worked for me in Android Studio (0.8.1):
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技术文章,二维码如下:(可扫描)