Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Merge Android Manifest ends up with 2 Activity

Discussion in 'Android' started by saeid-jaunt, Mar 21, 2018.

  1. saeid-jaunt

    saeid-jaunt

    Joined:
    Apr 25, 2017
    Posts:
    2
    Hi, I am trying to extend UnityPlayerActivity class. I've create an Android project that gives me an AAR file.

    now if I put that AAR file under Assets/Plugins/Android and make a build, the final APK has 2 Activities.
    one activity is the default UnityPlayerActivity and the second one is my activity.

    <activity android:name="com.unity3d.player.UnityPlayerActivity" >
    <meta-data
    android:name="unityplayer.UnityActivity"
    android:value="true" />
    </activity>
    <activity android:name="com.test.activity.TestActivity" >
    <meta-data
    android:name="unityplayer.UnityActivity"
    android:value="true" />
    </activity>

    somehow Unity is ignoring that my activity is also defining the meta tag for extending UnityActivity.

    Am I doing something wrong?
     
  2. saeid-jaunt

    saeid-jaunt

    Joined:
    Apr 25, 2017
    Posts:
    2
    I guess I figured it out, I just created a file named "AndroidManifest.xml" and put it under Assets/Plugins/Android. and that file is pretty much empty:
    <?xml version="1.0" encoding="utf-8" standalone="no"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android">
    <application>
    </application>
    </manifest>
    now, unity takes everything from my AAR AndroidManifest.xml file.