Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to resolve target 'Google Inc.:Google APIs:16'

Tags:

android

I experience this problem when I added another project from internet. I think it asks me to use another version of target android. But I want that my app will work in android 2.2.

But it doesn't require API-8, it requires API-16 and I m not sure what I should do.

like image 604
Sergey Avatar asked Sep 24 '12 14:09

Sergey


2 Answers

Modify the AndroidManifest.xml file so that any versions in there are Android 2.2. Also change the version of the SDK used by right clicking the project in eclipse and go to properties->android and change the version to 2.2. Some things might break though. Usually the version declared in the manifest is declared because the project uses SDK features only available for that version or later.

like image 68
Samuel Avatar answered Sep 20 '22 03:09

Samuel


Your app will still work on older versions even if you are targeting newer version. The target is what version you have tested your app to work on. If you target the most recent version (API 16), then your app will not be put in 'compatibility mode' when running on older phones. For example, if you have a menu button in 2.x but you target API 16, this menu button will not show up on certain phones since you're supposed to be using the ActionBar.

The minSdkVersion is what you are thinking of, which will make sure your app runs on older versions:

<uses-sdk android:minSdkVersion="8" />

So the solution to your problem is just to download the newest API level through the SDK Manager. You most likely just don't have API 16 installed.

like image 22
Nick Avatar answered Sep 22 '22 03:09

Nick