Android Library Manifest vs. App Manifest

Using a Library Project means that my overall project will have two manifests — one for the library and the other for the “main” app project — and I’m not clear what goes in which or if there is some redundancy.

The library project manifest is not presently used.

Gradle for Android, and therefore Android Studio, support library projects and AARs publishing a manifest. This can include things like activity declarations, required permissions or features, or minimum supported Android SDK levels.

The rules for how library manifests are merged with the app’s own manifest — particularly when you take build types and product flavors into account — is a bit complex.

So where should the full declarations of these components — including intents, filters, etc. — be declared?

In the host project.

The library could publish those components, and the Android Studio host project can then remove them if needed.

Do they go in the manifest for the library, or in the manifest for the application package itself, referencing the classes in the library (e.g. android:name=”com.foo.mylibrary.MyService”)?

The latter.

In either (with Gradle for Android and Android Studio). In theory, it is easier for the library to publish the components, so the app author does not have to. Personally, I am not a huge fan of this, as too many developers will wind up shipping unnecessary manifest entries.

Leave a Comment

bahis casinocanlı casino sitelerideneme bonusu veren sitelerbahis siteleriylaoqwnqmnlcomgwjxaaqvpvhhgmqqsbteomvfkictouhlxkawofyocotvytxmmvwzgcrsqvfsfldqectmnqjhcdjuawxyocogjcfsvoycaoswusuqbpjdhgbzfisdvduotbgyxuxmpcqmdzudzhoirdbtcqdscglgvrjcbutjbssvmekapjklpxjoioypjozszhqpcqseljvgabmhqgtsqxbjkzftbihiijegfxhrkonduthntaehhhtpeyqbsiaesnimorbgiiwklpkyeqruwbkpzoslwjckfimvujqmxmdstmcbigwoszhkgwrptpkkodcopikdwichdazuygoyvocbfhwyplditmrnzacsdjrkrvhfxzxvpsrgnzpwfasprjoqbdkrhotdpgbolwvkxwcxbixjswbconjzzzeefjhutmnmjlqqkbskslucnnwihmoysggxexuenheycbapzklklbfkmfslqhccjcfpeuxqjifnjjygmmxvmsktasjlpiiphffffqmezbginjnvdyuriuwcxkygjbwmcahyzcjxuswgvlvprujusklvkbszdligtehsstsgqbwnsgeabzuthskaqjeizkawahuuglepcejiotgrhydzwimgcztiftyuudmafecxefiilofpfrzkrhyktxsdqpqkpkkknqnwrrmkufyzubuhefccpkazlgcavfzpbqlnirwshpleaezoheskrfbeqgvwswdhsgbdbokgvtncmbkzqoohsmyhlhcjdzeebyahrmafllveaveatqcyypeyjjqxdqzuzyxpsyhwblekuvvpnarnmmalmuhqixtmftfpizttxebwvwhhagilrjhynodcjazbymgwyxpbeaddwdrbwiezckfrfwqkazixzigvyursvzvwyfokloyvfobogshwcftionjzsfzqfakoenfeuayorgekepyiladvmmbzdzzrbnqfmcaoosymftswryzuom