Multiple AndroidManifest.xml Guide

As of v1.11, Lumberyard has supported multiple AndroidManifest.XML files. As of today, the documentation on how to set up multiple manifests has been hard to find so I thought I’d post some nice information on the subject here…

Multiple AndroidManifest.xml Guide

During lmbr_waf configure, the base Android project structure is generated (e.g. main AndroidManifest.xml, Java stubs, other required Android resources). The default location these files are generated in is Solutions/LumberyardAndroidSDK/Launcher but can be configured to a different location by editing the following properties in WAF/user_settings.options

[Android Project Generator]
android_studio_project_name = LumberyardAndroidSDK
android_studio_project_folder = Solutions

Option 1: Adding the variant manifest directly to the project

Once the base project has been created, you can add your variant specific AndroidManifest.xml (or other resources) by creating a sub-directory for the variant in the base project (see above for location).

For Example: To add a debug manifest, the directory structure would look something like the following

 <Dev_Root>
|
|-> Solutions
|
|-> LumberyardAndroidSDK
|
|-> <Project>Launcher
|
|-> src
|
|-> main
| |
| |-> AndroidManifest.xml
| |
| |-> ...
|
|-> debug
|
|-> AndroidManifest.xml

NOTE: The next time configure is ran, any changes to the base project will be lost!

Option 2: Adding the variant manifest to the project builder

Alternatively, you can tap into the base project generation itself and inject your variant manifests there. The base project builder files live in <Dev_Root>/Code/Launcher/AndroidLauncher/ProjectBuilder. This directory contains all the default and template files necessary for generating the base Android project structure. The file you will want to modify is android_builder.json, which defines how and where to copy the project files. Each map key with nested children will result in a directory being created, while leaf nodes will either perform a straight copy or copy+rename on the source file.

For Example: To add a debug manifest, the project builder JSON would look something like

    {
"src" :
{
"main" :
{
...
},
"debug" :
{
"" :
{
"AndroidManifest_debug.xml" : "AndroidManifest.xml"
}
}
}
...
}

If you have multiple game projects enabled, the variant files will be applied to ALL game projects

Complete Variant Options List:

  • main
  • debug
  • profile
  • release
  • android_armv7_clang
  • android_armv7_clangDebug
  • android_armv7_clangProfile
  • android_armv7_clangRelease
  • android_armv8_clang
  • android_armv8_clangDebug
  • android_armv8_clangProfile
  • android_armv8_clangRelease