I’m trying to add a < supports-screens > tag as a child of < manifest > in the generated AndroidManifest.xml file.
There is a field called “Extra Tags for < manifest >`` node” that sounds like it should do this, but it actually adds attributes (i.e. attribute="value" pairs) to the node, not tags.
Trying to add a tag in this section results in malformed XML like this:
Aside from the fact that this field should be renamed to “Extra attributes for < manifest > node” and a new field “Child nodes/tags for < manifest > node” should be created, is there any way for me to add extra child nodes to the < manifest > node?
If anyone is interested in how to get extra actual tags (not attributes) under the < manifest > node, you can actually hack the “Extra permissions” section to inject XML. Just add a valid permission (I chose READ_EXTERNAL_STORAGE), then add a double quote and closing tag "/> to complete the permission node, then add your XML, then leave off your last double quote and closing tag "/> as that will be added by Unreal.
The text I added in one of the “Extra permissions” slots was:
You should confrim that in 4.10 (I confirm, but without details now) and repost it in Bug Reports category. It will helps others and might be fixed in 4.11
Everything inside ManifestRequirementsOverride.txt gets put inside the manifest tag.
Note that this replaces any existing requirements.
As of 4.11 the requirements are:
<!-- Entery your SDK versions here as required -->
<uses-sdk android:minSdkVersion=\"21\" android:targetSdkVersion=\"21\"/>
<uses-feature android:glEsVersion=\"0x00020000"\" android:required=\"true\" /> <!-- or 0x00030000 -->
<uses-permission android:name=\"android.permission.INTERNET\"/>
<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>
<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>"
<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>"
<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>"
<uses-permission android:name=\"com.android.vending.CHECK_LICENSE\"/>"
<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>"
<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>"
<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>"
<uses-permission android:name=\"android.permission.VIBRATE\"/>"
<!-- and billing if used -->
<uses-permission android:name=\"com.android.vending.BILLING\"/>
The more technically inclined might want to look at the C# code in UnrealEngine\Engine\Source\Programs\UnrealBuildTool\Android\UEDeployAndroid.cs (around line 1923 in the GenerateManifest function).
Bumping. This is still a problem, and so far there is no official word on the matter. Causing us real headaches at the moment!
Additionally, there are duplicate keys being generated in the manifest which means debugging Android is literally impossible right now. I’m following this guide: http://zompi.pl/unreal-engine-4-debugging-on-android/
I did, but don’t fully understand how you did it. I’m looking at the packaging settings in the Project Settings, not seeing where you’ve added what you did.
Irritating that we can’t just edit the XML directly
The hack works by injecting your XML into the “Extra Permissions” section rather than using the “Extra tags for application node” section.
When you add a permission, the XML generator generates < uses-permission android:name=", then inserts the permission you specified, then closes the tag by adding " /> to the end. What the hack does is prematurely closes the uses-permission tag, then adds your XML (which is missing the final quotation mark and closing tag), then lets the generator add " />, resulting in valid XML.
The generated XML looks like this, and appears below the rest of the uses-permission tags:
You can also use ManifestRequirementsAdditions.txt which just adds to the requirements without requiring the full section be replaced like with ManifestRequirementsOverride.txt.