Monday, June 20, 2011

Android SDK Error: Unable to resolve target 'Google Inc.:Google APIs:X'

I the past I wrote a post on a similar issue, but here goes -
There are few variants of this error message:
Unable to resolve target 'Google Inc.:Google APIs:1'
Unable to resolve target 'Google Inc.:Google APIs:2'
Unable to resolve target 'Google Inc.:Google APIs:3'
Unable to resolve target 'Google Inc.:Google APIs:4'
Unable to resolve target 'Google Inc.:Google APIs:5'
Unable to resolve target 'Google Inc.:Google APIs:6'
Unable to resolve target 'Google Inc.:Google APIs:7'
Unable to resolve target 'Google Inc.:Google APIs:8'
Unable to resolve target 'Google Inc.:Google APIs:9'
Unable to resolve target 'Google Inc.:Google APIs:10'
Unable to resolve target 'Google Inc.:Google APIs:11'
Unable to resolve target 'Google Inc.:Google APIs:12'
Unable to resolve target 'Google Inc.:Google APIs:13'
Unable to resolve target 'Google Inc.:Google APIs:14'
Unable to resolve target 'Google Inc.:Google APIs:15'
Unable to resolve target 'Google Inc.:Google APIs:16'
Unable to resolve target 'Google Inc.:Google APIs:17'
Unable to resolve target 'Google Inc.:Google APIs:18'
Unable to resolve target 'Google Inc.:Google APIs:19'
Unable to resolve target 'Google Inc.:Google APIs:20'
Unable to resolve target 'Google Inc.:Google APIs:21'

Reason: Could not find the proper Google APIs Android SDK version. If the android SDK is installed correctly the problem is that the platform SDK requested by the "AndroidManifest.xml" android:minSdkVersion is not installed. For example:
'Google Inc.:Google APIs:1' - change the Android SDK in the project properties
'Google Inc.:Google APIs:2' - change the Android SDK in the project properties
'Google Inc.:Google APIs:3' - install Google APIs SDK Android 1.5
'Google Inc.:Google APIs:4' - install Google APIs SDK Android 1.6
'Google Inc.:Google APIs:5' - install Google APIs SDK Android 2.0
'Google Inc.:Google APIs:6' - install Google APIs SDK Android 2.0.1
'Google Inc.:Google APIs:7' - install Google APIs SDK Android 2.1
'Google Inc.:Google APIs:8' - install Google APIs SDK Android 2.2
'Google Inc.:Google APIs:9' - install Google APIs SDK Android 2.3
'Google Inc.:Google APIs:10' - install Google APIs SDK Android 2.3.3
'Google Inc.:Google APIs:11' - install Google APIs SDK Android 3.0
'Google Inc.:Google APIs:12' - install Google APIs SDK Android 3.1
'Google Inc.:Google APIs:13' - install Google APIs SDK Android 3.2
'Google Inc.:Google APIs:14' - install Google APIs SDK Android 4.0
'Google Inc.:Google APIs:15' - install Google APIs SDK Android 4.0.3
'Google Inc.:Google APIs:16' - install Google APIs SDK Android 4.1
'Google Inc.:Google APIs:17' - install Google APIs SDK Android 4.2
'Google Inc.:Google APIs:18' - install Google APIs SDK Android 4.3
'Google Inc.:Google APIs:19' - install Google APIs SDK Android 4.4
'Google Inc.:Google APIs:20' - change the Android SDK in the project properties
'Google Inc.:Google APIs:21' - install Google APIs SDK Android 5.0.1

You can do this using the Android SDK Setup utility:
Option 1: Eclipse -
"Windows" -> "Android SDK and AVD Manager" -> "Available packages" -> "Third Party" -> "Google"

Option 2: Command line - start the "SDK Setup" here (x86):
C:\Program Files\Google\Android SDK\SDK Setup.exe
or here (x64)
C:\Program Files (x86)\Google\Android SDK\SDK Setup.exe

4 comments:

Jason Fritz said...

Thanks a lot! I just imported a project being developed by others and had this problem. Turns out they were using "Google Inc.:Google APIs:12" rather than "android-12". In other words, it seems they were using the unofficial (pre-release?) Android 3.1 API 12 rather than the stock SDK.

Unknown said...

What about Android Studio??? If there is way to solve this issue in ANdroid studio please do let me know...
THank you!!!

Sagi said...

@Surya - never used Android Studio, but it should be the same - install the Android Platform SDK with Google API from the Android SDK Manager or change the project properties to support the SDK you have installed.

Unknown said...

oki... (Y) :)
But why do u suggest not to use Android studio??