在成功地将Eclipse-Android-Project导入到“Android Studio 1.4”后,我得到了错误
"Please select Android SDK"
当我点击按钮在模拟器中运行应用程序时,我找不到任何方法来这样做。
当我点击“run”时,这个对话框就会打开:
这是“项目结构”对话框:
我现在该怎么办?
在成功地将Eclipse-Android-Project导入到“Android Studio 1.4”后,我得到了错误
"Please select Android SDK"
当我点击按钮在模拟器中运行应用程序时,我找不到任何方法来这样做。
当我点击“run”时,这个对话框就会打开:
这是“项目结构”对话框:
我现在该怎么办?
当前回答
Source Compatibility should be selected as the minimum Android Version that your app should be compatible with(usually selected as SDK 15), Target Compatibility should be selected as the newest Android Version that your app should be compatible with(SDK 23). Afterwards you want to check your AndroidMenifest and your gradle.build to see if its realy set to the properties selected if not you can just add it manually. and ofcourse you should check the SDK Location is actually pointing to your android studio SDK folder (if you are importing from Eclipse then you should point to your Eclipse SDK folder).
其他回答
我在AS 3.0+的所有版本上都遇到了这个问题。与gradle同步并没有解决我的问题。来自András Klöczl的解决方案是唯一能让我完成一些编码的东西。问题是,每当我要做gradle同步时,问题又回来了。因此,每当我想要对build.gradle进行更改时,我都必须经历这个过程。最终对我有用的是将我的kotlin版本从1.2.40降级到1.2.30
Source Compatibility should be selected as the minimum Android Version that your app should be compatible with(usually selected as SDK 15), Target Compatibility should be selected as the newest Android Version that your app should be compatible with(SDK 23). Afterwards you want to check your AndroidMenifest and your gradle.build to see if its realy set to the properties selected if not you can just add it manually. and ofcourse you should check the SDK Location is actually pointing to your android studio SDK folder (if you are importing from Eclipse then you should point to your Eclipse SDK folder).
Work for me 1文件>关闭投影。2打开一个现有的Android Studio项目
按“Ctrl+shift+A”并在弹出的EditText中写入“Sync Project with Gradle Files”。然后双击出现的选项。然后它将同步您的Gradle文件SDK与项目文件。
我的问题是,如果我改变了项目(例如用不同的项目打开Android Studio的新窗口),就会发生这种错误。
所以我阅读了这个问题的每个答案,“清除缓存并重新打开项目”的解决方案在我的情况下并不是那么有用。
相反,我发现如果Kotlin插件在Android Studio中的版本低于gradle文件中的版本,问题就会出现。
我的设置是:
Android Studio 3.1.3 Kotlin插件(在Android Studio) 1.2.30 Kotlin版本在gradle文件1.2.51
是什么解决了这个问题?
我更新了Kotlin插件:
文件->设置->插件->安装JetBrains插件…
然后搜索Kotlin并单击Update。更新后只需重新启动Android Studio和同步Gradle。