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

"Please select Android SDK"

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

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

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

我现在该怎么办?


当前回答

我不得不将kotlin版本从1.2.41降低到1.2.31,以启用运行。 我的环境: macOS - 10.13.4 (high sierra) AS版本- 3.1.3

其他回答

构建开放。gradle文件。只需添加一个空格或按enter键。然后同步项目。它的工作原理……

在Android Studio 3及以上版本中,适用于Windows、Mac和Linux:

File -> Sync Project with Gradle Files

解决了!

或者你可以通过快捷键来完成:

按⌘+ Shift + A (Mac)或Ctrl + Shift + A (Windows, Linux)。然后弹出编辑文本并写入“同步项目与Gradle文件”。然后双击该选项。

你的问题解决了!它会同步你的gradle文件和你的项目文件。

截图:

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).

转到:文件>项目结构>模块->应用>属性

请选择:编译“SDK”版本= API26构建工具 版本号= 27.0.0源兼容性= 1.8目标兼容性= 1.8

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