在成功地将Eclipse-Android-Project导入到“Android Studio 1.4”后,我得到了错误

"Please select Android SDK"

当我点击按钮在模拟器中运行应用程序时,我找不到任何方法来这样做。

当我点击“run”时,这个对话框就会打开:

这是“项目结构”对话框:

我现在该怎么办?


当前回答

对于那些遇到此问题的人,我建议您进行一次干净安装(删除以前安装的任何现有设置和文件)。不要浪费时间解决问题。我正在搜索android studio 3.6.3的答案,没有结果。

其他回答

我在AS 3.0+的所有版本上都遇到了这个问题。与gradle同步并没有解决我的问题。来自András Klöczl的解决方案是唯一能让我完成一些编码的东西。问题是,每当我要做gradle同步时,问题又回来了。因此,每当我想要对build.gradle进行更改时,我都必须经历这个过程。最终对我有用的是将我的kotlin版本从1.2.40降级到1.2.30

简单:

制作项目

这对我很有效。

只需进入(应用程序级别)构建。gradle文件,给一个空白的地方,然后点击同步,一旦gradle显示同步完成,那么错误将会消失

After opening my project in Android Studio, I opened the App version of the build.gradle file, located in the Gradle Scripts folder of the Project. When I hovered my mouse pointer over the buildToolsVersion number, a tooltip popped, indicating that the version of Android Build Tools needed to be upgraded (see screenshot). I changed the value of the buildToolsVersion to the one identified by the error (27.0.2) and the problem was solved. The original error (Please select Android SDK) went away and the project compiled successfully, again. Although this solution was mentioned previously, the exact steps seemed to be missing, so hopefully this clears up any doubt. I guess the root cause for this problem is that a new version of the build tools were released but Android Studio did not trigger any notification to me, which would have indicated that I should manually fix this (since Android Studio does not seeem to have the ability to upgrade this build.gradle file internally), which leaves the onus on the user to find the problem and fix it.

我用Android Studio 3.1.3解决了这个问题:

在Android Studio中打开有问题的项目。单击“文件>导出到Zip文件”。 关闭有问题的项目(如有必要,退出Android Studio)。 在操作系统中,删除有问题的项目文件夹。然后提取刚才制作的压缩包。 回到Android Studio。在启动界面,点击“Open an existing Android Project”。浏览到刚才提取的文件夹。

就是这样。