Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I "select Android SDK" in Android Studio?

After a successful import of an Eclipse-Android-Project into "Android Studio 1.4", I get the error

"Please select Android SDK"

when I click on the button to run the application in simulator, but I can't find any way of doing that.

This dialog opens when I click on "run":

This dialog opens up when I click on "run"

This is the "project structure" dialog:

Screenshot of the "project structure" dialog

What should I do now?

like image 555
delete Avatar asked Dec 18 '15 10:12

delete


People also ask

Where is the Android SDK in Android Studio?

by default, the "Android Studio IDE" will be installed in " C:\Program Files\Android\Android Studio ", and the "Android SDK" in " c:\Users\username\AppData\Local\Android\Sdk ".

How do I choose Android SDK version?

What you need for SDK version is number in API level column of first table. This is how android section of build. gradle for app targeting Android 5.0 and newer should look like. Read more about targetSdkVersion , minSdkVersion and compileSdkVersion here.

How do I open Android SDK?

To open the SDK Manager from Android Studio, click Tools > SDK Manager or click SDK Manager in the toolbar. If you're not using Android Studio, you can download tools using the sdkmanager command-line tool. When an update is available for a package you already have, a dash appears in the check box next to the package.


2 Answers

FIX FOR 3.1.2 OR NEWER VERSIONS

Some of my colleagues and I have faced the same issue on AS 3.1.2, but a simple Sync didn't help us. For us, the solution was a bit different:

  1. File -> Invalidate Caches -> Invalidate
  2. File -> Close Project.
  3. Remove the project from the AS project selector window.
  4. Quit from Android Studio
  5. Start AS and open project again

reopen project instructions

EXTRA ADVICE IF YOU ARE FACING THIS ISSUE CONSTANTLY

Some of you are constantly facing this issue, and this "solution" fixes it only temporarily. At the time we started getting this error, we used gradle wrapper 4.6 and Android gradle plugin 3.1.0, but since then we went back to gradle 4.4 and we use it with the latest Android gradle plugin, and we haven't seen this issue since then.

like image 38
Andras Kloczl Avatar answered Sep 23 '22 02:09

Andras Kloczl


I go to build.gradle and click sync now. Then it worked.

Update :

File -> Sync Project with Gradle Files (Android Studio 3.1.1)

Tools -> Android -> Sync Project with Gradle Files (Android Studio 3.0.1)

Or You can click on the icon from the toolbar.

Sync Project Icon

This answer may not help works for later version as Android studio Team work on making the tool more better, the way to sync may be different in the next version of Android Studio.

COMMON WAY that may helps is try to sync project and then Invalidate Caches and Restart Android Studio.

Solution for Android Studio 3.1.2 [See below answer]

See Latest Android Studio version

like image 106
K.Sopheak Avatar answered Sep 23 '22 02:09

K.Sopheak