How can I get the AndroidManifest.xml-file to work? - it's seriously under-documented

Hey Guys,

Here is my Situation:

I want to Put Unstoppaball DX on the Android-Store ( itunes ), using my Android-License for Unity 3.

I’ve done all the legwork. It builds to my Nexus7-tablett. It plays well. It adapts too all types of available resolutions. It’s signed with my Code-Identity. I even got down to <50 MB for the Store-Requirements. The Store-Page is almost ready to be launched.

…except for the part where you need to manually check/uncheck all 2217+ Android-Devices if they are supported or not.

Some research Suggested the AndroidManifest.xml-file will take care of this. You can specify in the file to “Use Accelerometer-Devices Only”, thus telling the store-listing to automatically filter out ALL devives on which the game would not work anyway.

So. How do use it?

Because major research during the last days only confirmed that the usage of the AndroidManifest-files with Unity is severely under-documented. There are no tutorials, and all I could find are some cases of “Help this huge incomprehensible Manifest-file bugs out for some reason” and “It’s ‘Easy’! Just hack there 4 programs together in a command-line interface to manually sign your bleuargh etc etc”-threads.

What I gathered about the AndroidManifest.xml so far:

  • The File AndroidManifest.xml has to be placed in the folder assets/Android/AndroidManifest.xml to work. So I put a txt-file in there and renamed it to AndroidManifest.xml, and then modified it
  • Building and deploying the game Without the file works
  • Building with an Empty file fails
  • Building with a Rudimentary file fails

(The “rudimentary” file being

<?xml version="1.0" encoding="utf-8"?> )

And that’s about all the meaningful experiments I can do before it turns into planless trial+error.

My questions are

  • Do I actually NEED the AndroidManifest-file to put this onto the store? Could there be a different way to filter out non-accelerometer-devices?
  • How does a simple AndroidManifest-File have to look like to work? Just finding a base-version would give a starting-point from which to work with
  • Am I missing a step or approaching this wrong? Am I actually supposed to open the built apk-file and extract the AndroidManifest from there, and then modify it?

Any help at all would be extremely helpful.

-Matthias

1 Like

First you need to copy your custom Android manifest here: Assets/Plugins/Android/AndroidManifest.xml

You can copy the Android Manifest that Unity generates when you compile your game, it’s on folder: YourProjectname/Temp/StagingArea/AndroidManifest.xml, copy from there to Assets/Plugins/Android.

Filter non-accelerometer devices on AndroidManifest is the way to go, I don’t think you can filter non-accelerometer-devices without this but maybe I’m wrong.

1 Like

Thanks, that totally works!

Also found the line I wanted to manipulate :slight_smile:

1 Like