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 up when i click on "run":
This is the "project structure" dialog:
What should I do now?
Go to File >> ProjectStructure(⌘;). This would open this window then select the app module. Then choose the Compile SDK version . Choose the latest one and click apply.
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.
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
Just go to the (app level)
build.gradle
file, give an empty space somewhere and click on sync, once gradle shows sync complete then the Error will be goneIn my case there there is no selected java sdk version in project structure-
I had to select the -
1.Source Compatibility (1.7)
2.Target Compatibility (1.7)
as shown in image.
My problem was that if I changed the project (for example opened new window of Android Studio with different project) this error happened.
So I read every answer in this question and the "clear caches and open the project again" solution wasn't so useful in my case.
Instead I discovered that if the Kotlin's plugin's version in Android Studio was lower than in gradle file, the problem appeared.
My setup was:
What fixed the problem?
I updated the Kotlin plugin:
File -> Settings -> Plugins -> Install JetBrains plugin...
Then search for Kotlin and click Update. After update just restart the Android Studio and sync Gradle.
In my case I downloaded a git repository for an android project. The project required minimum sdk version 21 and target sdk version 27. When I tried to run the project it gave me "Please select Android SDK error". I checked that I had already downloaded the required sdk files.
For me the solution was to "sync project with Gradle Files"