I’m using Unity 2019.2.15f.
According to this page, when building an apk, the following happens:
1. Unity takes the main Android Manifest.
2. Unity finds all the Android Manifests of your plug-ins (AARs and Android Libraries)
3. Manifests from plug-ins are merged into the main Manifest using Google’s manifmerger class.
Steps 2-3 are not happening for me; my manifest appears to be ignored.
My plugin is built from C++ code and compiled into a .so. The folder structure is as follows:
/Assets/MyFancyLibrary/Plugins/Android/myfancylibrary.so (native code)
/Assets/MyFancyLibrary/Plugins/Android/AndroidManifest.xml (manifest)
With this structure, the AndroidManifest.xml is ignored at build time. I can write garbage in it and no error is triggered.
From what I could test, the only way for my AndroidManifest.xml to not be ignored is to place it in the special folder /Assets/Plugins/Android (at which point, my manifest overrides the default form Unity from step 1) and everything works. This is not ideal though, because I want to be able to distribute my library, as well as building multiple libraries and pick and chose between them. I therefore need the manifest merging to properly work.
Any suggestion?