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

AndroidManifest with UnityAds

Discussion in 'Unity Ads & User Acquisition' started by Shiranui, Apr 17, 2015.

  1. Shiranui

    Shiranui

    Joined:
    Oct 10, 2014
    Posts:
    2
    Hello guys,

    I can find only one androidmanifest.xml in my project, the one in Plugins/Android/unityads
    Do I need to change the line
    package = "com.unity3d.ads.android"
    to my custom package name ?
     
  2. chiphuc113

    chiphuc113

    Joined:
    May 3, 2015
    Posts:
    8
    I have the same question.
     
  3. Shiranui

    Shiranui

    Joined:
    Oct 10, 2014
    Posts:
    2
    I will answer my own question :)
    It seems the manifest is overwritten by the unity settings (player settings).
    So I did not change anything and in the .apk I could found my custom package name in the "package" field of the manifest.
     
  4. unity-nikkolai

    unity-nikkolai

    Joined:
    Sep 18, 2014
    Posts:
    540
    Unity has had the ability to merge android manifests since version 4.6. You don't need to edit the Unity Ads android manifest. Unity will merge it and any other android manifests in your project with your game's android manifest.
     
  5. Spiritmibilegame

    Spiritmibilegame

    Joined:
    Jun 4, 2015
    Posts:
    4
    I'm having issues with merging my android manifests. I've attached screen caps of the errors I'm getting. How can I go about fixing this? I asked a friend who's familiar with this issue, and he manually merged my Android manifest files for me. I deleted the other ones, and kept the fully merged file in Plugins/Android. I deleted the one in Plugins/Android/unityads but I get an error message saying that the Android manifest file in Plugins/Android/unityads is missing. When I restore the manifest file, I get the errors shown in the images below.

    Here are the error messages:
    Error: [Temp/StagingArea/AndroidManifest-main.xml, /Users/Macchan/kathmandudrift/Temp/StagingArea/android-libraries/unityads-release/AndroidManifest.xml:8] Trying to merge incompatible /manifest/application/activity[@name=com.unity3d.ads.android.view.UnityAdsFullscreenActivity] element:


    UnityEditor.HostView:OnGUI()


    CommandInvokationFailure: Unable to merge android manifests. See the Console for more details.
    /Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/bin/java -Xmx2048M -Dcom.android.sdkmanager.toolsdir="/Users/Macchan/Library/Android/sdk/tools" -Dfile.encoding=UTF8 -jar "/Applications/Unity/Unity.app/Contents/PlaybackEngines/AndroidPlayer/Tools/sdktools.jar" -

    stderr[
    Error: [Temp/StagingArea/AndroidManifest-main.xml, /Users/Macchan/kathmandudrift/Temp/StagingArea/android-libraries/unityads-release/AndroidManifest.xml:8] Trying to merge incompatible /manifest/application/activity[@name=com.unity3d.ads.android.view.UnityAdsFullscreenActivity] element:
    <activity
    @android:name="com.unity3d.ads.android.view.UnityAdsFullscreenActivity"
    -- @android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
    -- @tools:ignore="UnusedAttribute">
    --</activity>
    <activity
    @android:name="com.unity3d.ads.android.view.UnityAdsFullscreenActivity"
    ++ @android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
    ++</activity>
    ++(end reached)
    ]
    stdout[
    Warning: [Temp/StagingArea/AndroidManifest-main.xml:3, /Users/Macchan/kathmandudrift/Temp/StagingArea/android-libraries/unityads/AndroidManifest.xml:11] Main manifest has <application android:name=''> but library uses name='com.soomla.SoomlaApp'.
    ]
    UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    UnityEditor.Android.AndroidSDKTools.RunCommandInternal (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    UnityEditor.Android.AndroidSDKTools.RunCommandSafe (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    UnityEditor.HostView:OnGUI()


    Error building Player: CommandInvokationFailure: Unable to merge android manifests. See the Console for more details.
    /Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/bin/java -Xmx2048M -Dcom.android.sdkmanager.toolsdir="/Users/Macchan/Library/Android/sdk/tools" -Dfile.encoding=UTF8 -jar "/Applications/Unity/Unity.app/Contents/PlaybackEngines/AndroidPlayer/Tools/sdktools.jar" -

    stderr[
    Error: [Temp/StagingArea/AndroidManifest-main.xml, /Users/Macchan/kathmandudrift/Temp/StagingArea/android-libraries/unityads-release/AndroidManifest.xml:8] Trying to merge incompatible /manifest/application/activity[@name=com.unity3d.ads.android.view.UnityAdsFullscreenActivity] element:
    <activity
    @android:name="com.unity3d.ads.android.view.UnityAdsFullscreenActivity"
    -- @android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
    -- @tools:ignore="UnusedAttribute">
    --</activity>
    <activity
    @android:name="com.unity3d.ads.android.view.UnityAdsFullscreenActivity"
    ++ @android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
    ++</activity>
    ++(end reached)
    ]
    stdout[
    Warning: [Temp/StagingArea/AndroidManifest-main.xml:3, /Users/Macchan/kathmandudrift/Temp/StagingArea/android-libraries/unityads/AndroidManifest.xml:11] Main manifest has <application android:name=''> but library uses name='com.soomla.SoomlaApp'.
    ]


    What's the issue I'm facing and how should I go about resolving it?

    Screen Shot 2015-10-02 at 12.32.56 PM.png Screen Shot 2015-10-02 at 12.35.04 PM.png Screen Shot 2015-10-02 at 12.35.15 PM.png Screen Shot 2015-10-02 at 12.35.26 PM.png
     
    Seg_fault_ likes this.
  6. Spiritmibilegame

    Spiritmibilegame

    Joined:
    Jun 4, 2015
    Posts:
    4
    Hello? Anybody have any idea what the issue here is?
     
  7. JamesLeeNZ

    JamesLeeNZ

    Joined:
    Nov 15, 2011
    Posts:
    5,616
    In one of the recently released Unity versions (maybe 5.2), they integrated UnitysAds into the engine which means you no longer have to edit the manifest.
     
  8. Spiritmibilegame

    Spiritmibilegame

    Joined:
    Jun 4, 2015
    Posts:
    4
    I know about the recent integration of UnityAds to Unity, that's what I used when attempting to make that build. And yet I still get that error message, what is the solution to solve this issue?
     
  9. JamesLeeNZ

    JamesLeeNZ

    Joined:
    Nov 15, 2011
    Posts:
    5,616
    1. Are you using latest build of Unity (5.2.1)

    2. Did you download the Unity Ads SDK?

    If both answers are yes, you need to remove all UnityAds SDK stuff from your project.

    I believe the error is occurring because you have a manifest in the SDK folder which its trying to merge it with your main manifest, causing the conflict.
     
  10. Spiritmibilegame

    Spiritmibilegame

    Joined:
    Jun 4, 2015
    Posts:
    4
    We are using Unity (5.2.0f3) and I did download the Unity Ads SDK, before realizing it was part of Unity Services, so I've already deleted it from the project. I still have folders like "unityads.budle Import Settings," "unityads Import Settings" and "unityads.framework Import Settings." Were these created when I activated Unity ads, or are they from the package I had before?
     
  11. neutt22ads

    neutt22ads

    Joined:
    Oct 13, 2015
    Posts:
    5
    Found a solution for this because I ran into the same situation today:

    Just remove the Unity Ads plugin on your Assets folder.
     
  12. JamesLeeNZ

    JamesLeeNZ

    Joined:
    Nov 15, 2011
    Posts:
    5,616
    Get rid of everything related to Unity Ads. There should be no files/folders at all from memory.
     
    reef99 likes this.