Manifest Merge Problem
Hello, I faced the problem with manifest merging. I use custom manifest. And i got error when i am adding permission.C2D_MESSAGE permissions. Without it there no errors. How to understand the problem? I checked libraries and there no thoose permissions. I'm using Unity 5.6.1f1
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom.mylib.test/Manifest;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom.mylib.test/Manifest$permission;
Manifest Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:amazon="http://schemas.amazon.com/apk/res/android" android:installLocation="preferExternal" android:theme="@android:style/Theme.NoTitleBar" package="com.myapp.test" android:versionName="1.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:debuggable="true">
<activity android:name="com.unity3d.player.UnityPlayerProxyActivity" android:launchMode="singleTask" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.unity3d.player.UnityPlayerActivity" android:launchMode="singleTask" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:screenOrientation="portrait">
<intent-filter>
<action android:name="com.myapp.test.MESSAGE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="com.unity3d.player.UnityPlayerNativeActivity" android:launchMode="singleTask" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:screenOrientation="portrait">
<meta-data android:name="android.app.lib_name" android:value="unity" />
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
</activity>
</application>
<uses-feature android:glEsVersion="0x00020000" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<!-- GCM part -->
<permission android:name="com.myapp.test.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="com.myapp.test.permission.C2D_MESSAGE" />
</manifest>
Update: I just tried build via gradle and there no errors, seems internal builder is bugy
These classes somehow get included twice into your AP$$anonymous$$:
com.myapp.test/$$anonymous$$anifest com.myapp.test/$$anonymous$$anifest$permission
you can also check the Temp/StagingArea folder after the build fails, to see all android manifests that Unity attempts to merge together. maybe that can lead you where is the problem.
These classes somehow get included twice into your AP$$anonymous$$
Yeah, i understand the error, but it is about permissions. if I remove thoose lines error disappears. I just figure out if i remove one aar file error disappears also. But there no persmission at all
<!-- GC$$anonymous$$ part -->
<permission android:name="com.myapp.test.permission.C2D_$$anonymous$$ESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="com.myapp.test.permission.C2D_$$anonymous$$ESSAGE" />
There manifest of com.mylib.test. When I add this lib to unity error apears. And it conflicts with C2D_$$anonymous$$ESSAGE persmisions somehow. I unpacked aar file and there also no any permisions.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mylib.test">
<application>
</application>
</manifest>