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

"Please select Android SDK"

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

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

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

我现在该怎么办?


当前回答

来自@Nisarg的评论帮助:“在编译Sdk版本中设置最新版本”

我把API 8改成了API 23,错误信息消失了。

其他回答

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

在我的情况下,没有选择java sdk版本的项目结构-

我必须选择-

1.源兼容性(1.7)

2.目标兼容性(1.7)

如图所示。

如果你的android SDK路径是给定的,但你仍然面临这个问题,那么这可能是因为你的android工作室没有很好地同步,即使你点击了“立即同步”链接。

为了重新同步,去到app gradle文件,做些改变,或者给一个空间,然后再同步。它会完美工作的。

现在在Android Studio 3及以上,你可以尝试同步项目与gradle如下:

File -> Sync Project with Gradle Files

从Android 3.2.0开始,菜单结构和选项略有变化。我通过更改下面菜单中的模块SDK来修复这个错误:

>项目结构>模块>应用文件>依赖选项卡>模块SDK

确保点击Apply保存更改。