32

I am getting the warning:

Attribute minSdkVersion (3) is lower than the project target API level (8)

How will this affect my app?

Sheehan Alam
  • 60,111
  • 124
  • 355
  • 556
  • the SDK elements in the android manifest are really weird. Starting by the name. they do not mean what they say... It has nothing to do with SDK but API. Also this very message defeats the purpose of minSdkVersion by itself. – gcb Feb 24 '11 at 09:44

3 Answers3

25

You can safely ignore the warning.

It's a weird warning - it means you are using tools for API level 8 (Android 2.2/Froyo) but targeting API level 3 (Android 1.5/Cupcake). That warning will always come up unless you you were using the SDK to target the Android release it coincides with - in this case, you would have to target Android 2.2 with your current SDK.

wkl
  • 77,184
  • 16
  • 165
  • 176
  • 34
    It _does_ mean that you'd better do extensive testing. Since you're compiling against the target API, there is no guarantee that all of the classes and methods you reference will be present in the earlier APIs that the "minSdkVersion" obliges you to support. You are responsible for either making sure you don't use any of those newer interfaces, or that you fail gracefully if they aren't present. – beekeeper Oct 12 '10 at 03:54
17

I do most of my development with the project set to the minSdkVersion level. That pretty much guarantees that I'm not using any more recent APIs. I then switch to my targetSdkVersion level before publishing the app. The only problem I've run into so far is that the lower level doesn't support some manifest syntax that I need to use in production. (Level 3, for instance, doesn't support targetSdkVersion.) I just fix up the manifest after switching to the higher level.

Ted Hopp
  • 232,168
  • 48
  • 399
  • 521
  • This is an interesting technique. You do realize that it's ok, and can be beneficial to your users, to use APIs that are newer than (and therefore don't exist in) `minSdkVersion`? That way, users with more modern operating systems than minSdkVersion can enjoy more modern features in your app, while ancient users running minSdkVersion can still use your app too. You just need to be careful about backwards compatibility, as @beekeper comments in the accepted answer. – Goffredo Dec 18 '12 at 01:52
  • @Jeffro - Yes, I'm aware of that, thanks. I'm also aware of the lazy loading and related techniques described in [Adam Powell's blog post](http://android-developers.blogspot.com/2010/07/how-to-have-your-cupcake-and-eat-it-too.html). I still like programming to the lowest level API I intend to support and to use later features only if the app really demands them. – Ted Hopp Dec 18 '12 at 02:11
3

See also Dianne Hackborn's response in this thread: https://groups.google.com/group/android-developers/browse_thread/thread/c468e795daf439f8?pli=1#

nmr
  • 16,625
  • 10
  • 53
  • 67