It’s all pretty much in the title. Although I see <uses-sdk> specified in all the example library project’s AndroidManifest.xml I’ve seen, I have a feeling it’s irrelevant.
In fact, I suspect that <uses-permission> is also irrelevant, as are all of the attributes of <manifest>, other than package.
Can anyone confirm?
As of ADT r20 preview 3
Library manifests can be merged with the main application manifest. This is enabled in an ant build by specifying the property
[I’m not sure how to enable it in other (e.g. maven) builds; please comment here if you figure it out. I’m guessing it translates into an aapt command line argument.]
A variety of rules govern conflicts and overriding behavior.
Relative to the specific questions raised here (merging of <uses-sdk> and <uses-permission>), the rules for <uses-sdk> are:
The rule for <uses-permission> is: add library permissions to destination if they are not already present there. It’s OK if the same permission is in both.
If you are using ADT r20 preview 2 or earlier, the following applies:
I created a little test library project and a test app that uses it, in order to get to the bottom of this myself. I provided a <uses-sdk> and a <uses-permission> in the library project’s manifest, and omitted both of them from the application’s manifest.
The result was that the library project’s <uses-sdk> and <uses-permission> values were NOT merged into the application at build time, as evidenced by examining the installed app on my device using the AppXplore tool.
My test code is available at https://github.com/adennie/android-library-project-manifest-test.
My conclusion is that specifying <uses-sdk> and <uses-permission> in an Android Library Project’s manifest has no effect on the merged manifest of the consuming application.