It is safe to delete library module AndroidManifest before release compiling?

1.2k Views Asked by At

I have a library module with a dummy manifest (which is an exact copy of my application manifest but with package name changed) which i used in the past (eclipse) to test the library without an application module. Now in android studio i can test and debug with breakpoints the library launching it with my application module, so the dummy manifest of the library is not neccesary anymore.

Can i delete the library manifest before release compile? Manifest merger is giving me a lot of problems, duplicating a lot of things on my manifest, so if it is possible whould be better for me to delete the library module.

It is safe to delete it or this will give me problems in the future?

Thanks

1

There are 1 best solutions below

0
On

Well, i will post an answer made with the comments of CommonsWare (thank you!)

Bassically, activities, receivers etc... that are used in the library, should be declared only in the library and not in the application module, manifest merger will add them into the final manifest.

It works for activities but not for receivers, providers and special permisions like C2DM which needs application package name as an atribute inside the elements. Why? because these elements are merged in the final manifest with the same package name as the library, not with the package name of the application, and all three elements needs to have the application package name. For those, we should use use manifest placeholders: http://tools.android.com/tech-docs/new-build-system/user-guide/manifest-merger#TOC-Placeholder-support

Thanks CommonsWare