Search Unity

UnityEngine.Advertisements.ShowResult defined multiple times with LTS and Asset Store IAP

Discussion in 'Unity Ads & User Acquisition' started by stevenatunity, May 1, 2018.

  1. stevenatunity

    stevenatunity

    Joined:
    Apr 17, 2015
    Posts:
    114
    I've just updated my project to LTS Release 2017.4.2f2 and I am using Unity Ads from the Asset Store (updated to the latest version).

    My project built without error on 2017.4.1f1, but after updating the project I am now getting this error...

    The imported type `UnityEngine.Advertisements.ShowResult' is defined multiple times​

    Would there be an obvious reason for this?

    Thanks :)
     
  2. stevenatunity

    stevenatunity

    Joined:
    Apr 17, 2015
    Posts:
    114
    It seems to be a clash between UnityEngine.Advertisements and UnityEngine.Advertisements.Editor but going from

    using UnityEngine.Advertisements;

    Advertisement.IsReady...
    to

    UnityEngine.Advertisements.Advertisement.IsReady...
    is still showing an error.
     
  3. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    Confirmed, unfortunately...

    Still investigating, but my findings so far using our example project https://github.com/Unity-Technologies/unity-ads-assetstore-test :
    - Create project in 2017.4.2f2 -> fails with "The imported type (...) is defined multiple times" error
    - Create project in 2017.4.1f1 -> works, even when opening project in 2017.4.2f2 afterwards

    Will continue investigating to see if I can find workaround, and then report issue internally so we can get it fixed asap.

    Thanks for reporting.

    Best regards,
    Rasmus
     
    stevenatunity likes this.
  4. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    Yes, workaround for now seems to be:

    - Open project in Unity 2017.4.1f1
    - Select menu item Assets->Reimport All

    /Rasmus
     
    stevenatunity likes this.
  5. stevenatunity

    stevenatunity

    Joined:
    Apr 17, 2015
    Posts:
    114
    @rasmus-unity my project which had been 2017.4.2f2ed when opened in 2017.4.1f1 still showed the defined multiple times error, so I'll check your workaround.

    It's okay as I've got a backup of the project. I'm not an idiot ;) On this occasion :rolleyes:
     
  6. TFGCo4

    TFGCo4

    Joined:
    Dec 3, 2014
    Posts:
    3
    As a alternative workaround if you want to use 2017.4.2f2, edit the Unity.app/Contents/Resources/PackageManager/Editor/manifest.json file and strip out these dependencies.
     
    Valdeco likes this.
  7. Deleted User

    Deleted User

    Guest

    I ran into the same problem with both 2017.4.2f2 and 2018.10f2.

    Toggling Unity Ads on/off in Services didn't work (partly hampered by it always enabling Use Built-In Extension every time it's toggled on), but Reimport Assets worked.

    I have varying results with Unity Cloud Build. Some builds reported the problem, but one didn't even though it showed up in the manual build.