Where is the android manifest?

This link says that the resulting android manifest is at the folder Temp/StagingArea/AndroidManifest.xml. It’s not. I can’t find it anywhere. Where is the resulting AndroidManifest.xml from the build?? See picture below, there is no AndroidManifest. Using Unity 2021.1. Thank you.

2 Likes

If you need the final “Merged” AndroidManifest xml file you can look for the below path (Assuming you are >= 2019.3)

On another note, wondering where you found that image link shared in your post. That sounds like the path from < 2019.3. If you can share the source, we can update with the latest details too :slight_smile:

1 Like

Export Android Studio project from Unity and you’ll find manifest in it.

Wut? Android Studio? I don’t use Android Studio. What does Android Studio has to do with Unity? I don’t care about it.

Ok thanks. You’re not talking about the androidmanifest of your plugin right? I’m not talking about the androidmanifest of voxelbusters. I’ll check the path you provided. Also, the image provided is from a Unity 2021.1 build on a mac.

Nope. It’s the path in general for “Merged” manifest file. You get Temp/gradleOut folder once you make an apk from unity.

You want Android manifest file generated by Unity?
Exported project will have it and you won’t need to go through temp folder searching for it. And you don’t need Android Studio itself.

Yes, As @Aurimas-Cernius mentioned, you can access the same file by exporting as android project too from build settings. Both will have same content.

I was just trying to point the file what unity (gradle) generates during its build process.

It’s not gradle generated file. The exported project still has multiple manifests.
If you want the truly final merged manifest, you need to build apk and decompile it.
Here I assumed you want to get the main manifest Unity generates so you can base your own template on it.

Ok…so the reason I’m asking where’s the android manifest is because I’m having the issue described here . Some dude says that I can edit the androidmanifest found at /Temp/StagingArea/AndroidManifest.xml . I also found this information on Unity’s documentation. Then I copy the edited manifest to plugins/android to overwrite the manifest.

How can I do this after all? There is no AndroidManifest in the StagingArea…is the documentation outdated?

1 Like

For such purpose certainly do export a project and you’ll find all manifests in there.

Am I correct that you refer to this page?
Yeah, it’s out of date, I’ll open bug report to update it. Not only there is more than one manifest since Unity as a Library introduction, but also since project export exists it’s ridiculous to tell people to catch some temp files before Unity deletes them :frowning:

1 Like

While Manifest merger (jar) is part of android sdk tools, Gradle build process (during process manifest task) triggers it and generates the merged manifest by combining all manifests. We can even disable it through gradle task. Anyways…

True. There will be multiple manifest files in the exported Android project. I could we wrong in the wording.
However you can still see the “final Merged” Manifest from the Merged Manifest view of Android studio IDE.

No, Actually I’m trying to point him at the final merged manifest. Let me list down different ways so that it will be more clear for others to get “final merged manifest” file.

  1. Export an apk/aab and find the merged manifest in Temp/gradleOut/launcher/build/intermediates/merged_manifests/[debug|release]/AndroidManifest.xml
    or
  2. Export as android project and open the project in Android Studio, click an AndroidManifest.xml file and select Merged Manifest tab
    or
  3. Export an apk from unity or from android project(through Android Studio or gradle tasks from cli) and decompile it with a tool like jadx

Ok. From your post I see that you actually don’t need the merged manifest but the main manifest.
For adding the meta-data tag, you can simply click on “Custom Main Manifest” option and update the generated AndroidManifest.xml under Assets/Plugins/Android folder.

7863373--998557--Screenshot 2022-02-03 at 8.38.55 AM.png

5 Likes

This is a very bad suggestion, assuming to build manually every time instead of using an automatic build system. Why we just can’t get final manifest to edit it just before APK build? Google likes to change rules for features and permissions, i.e. for ChromeOS we must delete some features and permissions that UNITY generates atomatically. Export a project, edit manifest and build from Android Studio - definetly not an option. As full code refactoring for one beta platform.

You can make use of IPostGenerateGradleAndroidProject callbacks to modify the manifest files.

Yep, and all of them in temp folders.

I couldn’t find the Manifest file until I made an .apk. Used to only build .aab so there wasn’t an AndroidManifest.xml. Also I had to open a few more folders to find it. It wasn’t just Temp/StagingArea/
It hasn’t helped me solve the problem, though :frowning:

Newer unity versions save it in Library/bee/…

3 Likes

Posting an example I found from a Unity bug report that shows how to use IPostGenerateGradleAndroidProject to modify the AndroidManifest.xml after gradle. It was specifically for a workaround to a Unity issue in 2022.2.3 and other versions. Here is the script found in the bug report comments. Hope it helps someone!

4 Likes

Hi! very old issue here but maybe someone find it useful.
You can go to Player Settings → Player → Publishing Settings → Build-> Custom Main Manifest (check).
Now you can go in Project Assets\Plugins\Android\AndroidManifest.xml and edit the file.

8 Likes