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

"Please select Android SDK"

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

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

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

我现在该怎么办?


当前回答

有时android工作室只是愚蠢的行为,需要某种重置..

进入设置。Gradle文件应该包含“:app” 将其更改为包含':ap'和sync。 同步完成后,再次将其更改为包含':app'。

现在应该可以正常工作了。

其他回答

进入File >> ProjectStructure(⌘;)。这将打开这个窗口,然后选择应用程序模块。然后选择Compile SDK版本。选择最新的一个,然后单击apply。

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

我在Android Studio 4.0.1上得到这个错误。这是我的解决方案:去你的构建。gradle(Module: app)文件,然后更新compileSdkVersion和buildToolsVersion。

android {
    compileSdkVersion 30
    buildToolsVersion "30.0.2"
}

有时android工作室只是愚蠢的行为,需要某种重置..

进入设置。Gradle文件应该包含“:app” 将其更改为包含':ap'和sync。 同步完成后,再次将其更改为包含':app'。

现在应该可以正常工作了。

我只是把minSdKversion改成了23:

andriod {
    compileSdKVersion 27
    defaultConfig {
          minSdKversion 23
    }
}