Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

[Android] "Extra Tags for node" adds attributes, not tags

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:

 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
           <supports-screens android:smallScreens="false" android:normalScreens="false" android:largeScreens="false" android:xlargeScreens="true"/>

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?

Product Version: UE 4.9
more ▼

asked Sep 10 '15 at 05:12 AM in Packaging & Deployment

avatar image

142 16 19 33

avatar image rohoon Oct 22 '15 at 01:46 AM

Epic, can I get a response on this?

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:

 android.permission.READ_EXTERNAL_STORAGE"/> <supports-screens android:smallScreens="false" android:normalScreens="false" android:largeScreens="true" android:xlargeScreens="true" android:requiresSmallestWidthDp="600

Massive hack, but this was the only way I could find to add things like < supports-screens > tags.

avatar image MorskoyZmey Mar 30 '16 at 11:12 AM

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

avatar image MongooseJV Mar 26 '16 at 01:01 AM

I'm surprised there hasn't been any answer to this. What is the preferred method as I'm trying to add the following (to support tablets)

 <supports-screens android:largeScreens="true" android:xlargeScreens="true" />
avatar image rohoon May 31 '16 at 12:11 PM

Did you read the workaround I posted in a comment to the original question?

avatar image MorskoyZmey Jun 01 '16 at 05:23 AM

Did you used my solution? It's powerfull method, which might solve yours any other needs.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

3 answers: sort voted first

Put a file named ManifestRequirementsOverride.txt in the [YOUR GAME]/Build/Android folder as described at https://answers.unrealengine.com/questions/318771/removing-android-app-permissions.html This is apparently a temporary solution.

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).

more ▼

answered Apr 26 '16 at 09:51 AM

avatar image

246 7 3 9

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

This bug sucks. Fortunately there is APL (Android Plugin Language), wich can be used to modify manifest (and more).

more ▼

answered Mar 29 '16 at 03:03 PM

avatar image

377 12 159 43

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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/

more ▼

answered May 31 '16 at 12:07 PM

avatar image

815 59 97 140

avatar image rohoon May 31 '16 at 12:11 PM

Did you read the workaround I posted in a comment to the original question?

avatar image TheJamsh May 31 '16 at 03:39 PM

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 :/

avatar image TheJamsh May 31 '16 at 03:48 PM

Additionally, it doesn't work anymore. I was able to install it on a phone despite adding the tags you put above.

avatar image rohoon May 31 '16 at 09:48 PM

The < supports-screens > tag only comes into effect on the Play store - you can still deploy to a phone manually.

avatar image rohoon May 31 '16 at 09:58 PM

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:

 <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
   <supports-screens android:smallScreens="false" android:normalScreens="false" android:largeScreens="true" android:xlargeScreens="true" android:requiresSmallestWidthDp="600" />  

avatar image TheJamsh Jun 18 '16 at 03:29 PM

You're right, this does seem to work.

Horrible hack though :( Man this needs fixing.

avatar image MorskoyZmey Jun 20 '16 at 09:05 AM

Just use APL and you can modify any node you want using platform dependent variables

avatar image Chris Babcock STAFF Jun 20 '16 at 06:43 PM

You can also use ManifestRequirementsAdditions.txt which just adds to the requirements without requiring the full section be replaced like with ManifestRequirementsOverride.txt.

avatar image rohoon Jun 20 '16 at 10:49 PM

Good tip, thanks Chris :)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question