在成功地将Eclipse-Android-Project导入到“Android Studio 1.4”后,我得到了错误
"Please select Android SDK"
当我点击按钮在模拟器中运行应用程序时,我找不到任何方法来这样做。
当我点击“run”时,这个对话框就会打开:
这是“项目结构”对话框:
我现在该怎么办?
在成功地将Eclipse-Android-Project导入到“Android Studio 1.4”后,我得到了错误
"Please select Android SDK"
当我点击按钮在模拟器中运行应用程序时,我找不到任何方法来这样做。
当我点击“run”时,这个对话框就会打开:
这是“项目结构”对话框:
我现在该怎么办?
当前回答
构建开放。gradle文件。只需添加一个空格或按enter键。然后同步项目。它的工作原理……
其他回答
我不得不将kotlin版本从1.2.41降低到1.2.31,以启用运行。 我的环境: macOS - 10.13.4 (high sierra) AS版本- 3.1.3
转到:文件>项目结构>模块->应用>属性
请选择:编译“SDK”版本= API26构建工具 版本号= 27.0.0源兼容性= 1.8目标兼容性= 1.8
有时android工作室只是愚蠢的行为,需要某种重置..
进入设置。Gradle文件应该包含“:app” 将其更改为包含':ap'和sync。 同步完成后,再次将其更改为包含':app'。
现在应该可以正常工作了。
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.
在我的例子中,我在项目级别build.gradle中有一个依赖项的双重声明。一旦我删除它,做了一个Gradle同步,它工作。