What happens if the minSdkVersion is lower than th

2019-01-31 18:22发布

问题:

I am getting the warning:

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

How will this affect my app?

回答1:

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.



回答2:

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.



回答3:

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