cancel
Showing results for 
Search instead for 
Did you mean: 

Can anybody help me merge an AndroidManifest?

Anonymous
Not applicable
Oculus plugin and Common Android Functionality. This is driving me crazy!

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.Oculus.Integration" android:versionName="1.0.0" android:versionCode="1">
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
<application android:icon="@drawable/app_icon" android:label="@string/app_name" android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" android:debuggable="false">
<meta-data android:name="com.samsung.android.vr.application.mode" android:value="vr_only"/>
<activity android:name="com.unity3d.player.UnityPlayerNativeActivity" android:label="@string/app_name" android:screenOrientation="landscape" android:launchMode="singleTask" android:configChanges="screenSize|orientation|keyboardHidden|keyboard">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
</activity>
</application>
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="19" />
<uses-feature android:glEsVersion="0x00030000" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
</manifest>



<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="codx.unity.commons" >
<!-- VIBRATE is needed only if your game uses the functions related to the vibrator, otherwise you can remove it or include it in this comment -->
<uses-permission android:name="android.permission.VIBRATE" />
<!-- CAMERA and FLASHLIGHT permissions are needed only if your game uses the flashlight or take picture functions (both of them are needed), otherwise you can remove them or include them in this comment -->
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<!-- INTERNET is needed either if your game uses internet or geo-localization functions, otherwise you can remove it or include it in this comment -->
<uses-permission android:name="android.permission.INTERNET" />
<!-- ACCESS_FINE_LOCATION, ACCESS_COARSE_LOCATION and ACCESS_MOCK_LOCATION are needed only if your game uses geo-localization functions, otherwise you can remove them or include them in this comment -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
<!-- The camera.flash feature is declared for letting know the system that your app will use the flash led. It's reccomended to keep this declaration (since it's declared as not required so it doesn't filter the device support of your game) -->
<uses-feature android:name="android.hardware.camera.flash" android:required="false" />
<!-- Don't touch what follows if you don't know what you're doing or if you want to do some experiment make a backup of this file to be sure you cen revert to the orignal version in case of chrashes -->
<application android:icon="@drawable/app_icon" android:label="@string/app_name" name="codx.unity.commons.CommonsApplicationInits" >
<!-- This activity goes to replace and extend the original Unity player -->
<activity android:name="codx.unity.commons.OverriddenPlayer" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- This activity is declared to allow AndroidCommons.OpenDirectory() to show the directory tree -->
<activity android:name="codx.unity.commons.BrowseDirectory" android:label="@string/app_name" android:uiOptions="splitActionBarWhenNarrow" >
</activity>
</application>
</manifest>
5 REPLIES 5

emma24xia
Honored Guest
Each element in a manifest file can be identified by its element type (e.g. activity, intent-filter) and an optional key value. Some elements like “activity” must have a key since there can be multiple present in a single AndroidManifest.xml. Other elements like “application” do not require a key since there can be only one.

The element type and key value pair represent the identity of a manifest element.

The merging activity is always between two identically typed elements, one coming from a higher priority manifest file, one coming from a lower priority manifest file. Each merging activity has a default behavior that will be described subsequently. Also each default merging activity on the node or on a specific attribute can potentially be overridden by including tools specific markers.

The merging process will also record all decisions taken along the way for each node, described in the "Logging" section.

Anonymous
Not applicable
Thank you for replying! What would I do for the manifest node? There are two different package attributes. Can these somehow merged as well? I've seen some examples where one package attribute was left out but I don't understand the rules.

jimdose
Explorer
I've merged the two manifests below. I made some assumptions of which was merging into which, and not knowing your project, I'm not sure what was necessary. You may need to change the package name (currently "codx.unity.commons"), for example. No guarantees this works in other words. 😉


<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="codx.unity.commons" android:versionName="1.0.0" android:versionCode="1">
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
<!-- VIBRATE is needed only if your game uses the functions related to the vibrator, otherwise you can remove it or include it in this comment -->
<uses-permission android:name="android.permission.VIBRATE" />
<!-- CAMERA and FLASHLIGHT permissions are needed only if your game uses the flashlight or take picture functions (both of them are needed), otherwise you can remove them or include them in this comment -->
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<!-- INTERNET is needed either if your game uses internet or geo-localization functions, otherwise you can remove it or include it in this comment -->
<uses-permission android:name="android.permission.INTERNET" />
<!-- ACCESS_FINE_LOCATION, ACCESS_COARSE_LOCATION and ACCESS_MOCK_LOCATION are needed only if your game uses geo-localization functions, otherwise you can remove them or include them in this comment -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<!-- The camera.flash feature is declared for letting know the system that your app will use the flash led. It's reccomended to keep this declaration (since it's declared as not required so it doesn't filter the device support of your game) -->
<uses-feature android:name="android.hardware.camera.flash" android:required="false" />
<uses-feature android:glEsVersion="0x00030000" />
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="19" />
<!-- Don't touch what follows if you don't know what you're doing or if you want to do some experiment make a backup of this file to be sure you cen revert to the orignal version in case of chrashes -->
<application android:icon="@drawable/app_icon" android:label="@string/app_name" name="codx.unity.commons.CommonsApplicationInits" >
<meta-data android:name="com.samsung.android.vr.application.mode" android:value="vr_only"/>
<!-- This activity goes to replace and extend the original Unity player -->
<activity android:name="codx.unity.commons.OverriddenPlayer" android:label="@string/app_name" android:screenOrientation="landscape" android:launchMode="singleTask" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
</activity>
<!-- This activity is declared to allow AndroidCommons.OpenDirectory() to show the directory tree -->
<activity android:name="codx.unity.commons.BrowseDirectory" android:label="@string/app_name" android:uiOptions="splitActionBarWhenNarrow" >
</activity>
</application>
</manifest>

Anonymous
Not applicable
THANK YOU! You are a life saver. Do you need to merge manifests by hand or is there some tool that will help merge?

jkimovr
Honored Guest
This is mostly a manual process unfortunately. There are resources online if you do a quick search but each project is different enough that you'll have to adopt a solution that works for you.