23

I am using Android Studio 2.0 Beta2, and i am trying to run old project that uses google maps api v1 (package com.google.android.maps) as *.jar file. To run this old project i need specify compileSdkVersion older than the last one (23). I used

compileSdkVersion 'Google Inc.:Google APIs:17'

But i got Error: Please select Android SDK error in Android Studio. How i can run this old project with older compileSdkVersion?

Lester
  • 2,544
  • 4
  • 27
  • 38

7 Answers7

53

Open gradle.buld in your app module change versionCode or versionName and sync.

abi
  • 1,002
  • 12
  • 15
24

Also just sync the project from the tool bar refer the image

abi
  • 1,002
  • 12
  • 15
8

the easiest way is to:

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

Thiago
  • 12,778
  • 14
  • 93
  • 110
4

With Android Studio 2.1.3, I got this message when trying to launch my app.

I used the Module Settings dialog in AS to select another compile SDK version. Then I went back to the same dialog and chose Google API 17 again.

Then AS accepted the settings and could launch my app.

Really weird, as the contents of the build.gradle file is identical to what it was when I had the error message.

Timores
  • 14,439
  • 3
  • 46
  • 46
2

I could fix the problem in my case you need to set the compileSdkVersion and the buildToolsVersion manually in the android studio. I don't know why the android astudio doesn't recognize the value from gradle.

So the steps are:

File/Project Structure/Flavors/

and set the buildToolsVersion and compileSdkVersion.

But you need to check, because the android studio puts this value at the end of the gradle file and if you have replicated this variables, the gradle build make an error. So I make cut and paste in here

android {
    defaultConfig {
        compileSdkVersion 22
        buildToolsVersion '22.0.0'
        minSdkVersion 15
        targetSdkVersion 22
        versionCode versionMajor * 10000 + versionMinor * 1000 + versionPatch * 100 + versionDevel
        versionName "${versionMajor}.${versionMinor}.${versionPatch}.${versionDevel}"
        multiDexEnabled = true
    }

and that's it!

Ciro Mine
  • 819
  • 8
  • 15
2

It is works for me

intelliJ IDEA 13 error: please select Android SDK

My Problem: "please select Android SDK", But everything is okey :( -> I think one of IntelliJ file was crashed (after blue screen of death)

My resolution:

File -> Settings -> Android SDK -> Android SDK Location Edit -> Next, Next (Android SDK is up to date.), Finished

... and crashed file was repaired!

I hope this will help!

Sirop4ik
  • 4,543
  • 2
  • 54
  • 121
0

I just went to my Gradle button on the far right of the screen on the side and refreshed it and it worked for me.