在成功地将Eclipse-Android-Project导入到“Android Studio 1.4”后,我得到了错误
"Please select Android SDK"
当我点击按钮在模拟器中运行应用程序时,我找不到任何方法来这样做。
当我点击“run”时,这个对话框就会打开:
这是“项目结构”对话框:
我现在该怎么办?
在成功地将Eclipse-Android-Project导入到“Android Studio 1.4”后,我得到了错误
"Please select Android SDK"
当我点击按钮在模拟器中运行应用程序时,我找不到任何方法来这样做。
当我点击“run”时,这个对话框就会打开:
这是“项目结构”对话框:
我现在该怎么办?
当前回答
点击Android Studio中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 SDK -> Android SDK位置编辑-> Android SDK
我去建造。Gradle和点击同步现在。然后就成功了。
更新:
文件->同步项目与Gradle文件(Android Studio 3.1.1)
工具-> Android ->同步项目与Gradle文件(Android Studio 3.0.1)
或者您可以单击工具栏上的图标。
这个答案可能对以后的版本没有帮助,因为Android studio团队正在努力使工具变得更好,在下一个版本的Android studio中,同步的方式可能会有所不同。
常见的方法,可能有助于尝试同步项目,然后无效缓存和重新启动Android工作室。
Android Studio 3.1.2解决方案[见下文答案]
请参阅最新的Android Studio版本
遵循以下步骤:
转到Android Studio设置 使用搜索栏搜索“Android SDK” 确保android sdk文件夹的路径是正确的。 在此之后,还要确保路径在项目(local.properties)文件中的提示符后自动更新。如果没有,请手动操作。
希望这能有所帮助。
来自@Nisarg的评论帮助:“在编译Sdk版本中设置最新版本”
我把API 8改成了API 23,错误信息消失了。