Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Can't upgrade Unity Ads to the latest version

Discussion in 'Unity Ads' started by momcil0, Apr 2, 2019.

  1. momcil0


    May 23, 2016
    I have a game which is live on App Store and Google Play. Video ads work on both apps. They were built on Mac with Unity
    . Now when I try to build for Android and iOS, ads don't work, and here is what I'm doing.
    1. I upgraded Unity to
      . I decided to keep Unity
      because most of my scripts are in UnityScript. I know that's legacy, but time is crucial now and besides Monetization 3.0.3 is supposed to be working with it.
    2. I open the backed-up project (the one that works on both stores). It is imported succesfully from 2018.2.18 version. In
      it says
      "": "2.0.8"
      , which is in fact the version that was used in the build.
    3. I Build&Run it for Android as is, deploy it on the device and the video ads don't show anymore. In Editor, everything seems to be working fine.
    4. When I open Services/Ads, I get the warning that I should update Unity Ads to the latest version or re-enable the internal Ads extension.
    5. I first try to re-enable the internal ads extension. Build fails with:
      Code (JavaScript):
      1. Execution failed for task ':transformDexWithDexForRelease'.
      2. > java.util.concurrent.ExecutionException: Multiple dex files define Lcom/unity3d/ads/BuildConfig;
    6. I then turn off built-in Ads Extension, and I get the same message in Services/Ads - to import the latest Unity Ads plugin from the asset store.
    7. I first try to update it via Package Manager, which shows that I have "Ads" package
      and offers the update to
      . I update it and that seems to succeed as the name of the package changes to "Advertisement" and
      now says
      "": "2.3.1"
      , but I get the following error in the console:
      Code (JavaScript):
      1. error CS1704: An assembly with the same name `UnityEngine.Advertisements.Editor' has already been imported. Consider removing one of the references or sign the assembly
      2. Assets/UnityAds/UnityEngine.Advertisements.Editor.dll (Location of the symbol related to previous error)
      3. /Users/momcilo/Library/Unity/cache/packages/ (Location of the symbol related to previous error)
    8. Following some advices I found on the internet, I did
      Assets/Reimport All
      to solve this issue. It didn't help and I still get the same error as in 7.
    9. I then went to Asset Store, found Monetization 3.0.3 and tried to import it. It apparently succeeded, but the errors remained the same, and
      still states
      "": "2.3.1"
    10. Following advice from one of the forum posts, I wanted to delete the Advertisement package from Package Manager, but... Package Manager wasn't there anymore?! I gave up at this point.
    I am completely confused as to what to do from this point on. Ideally:
    • I would like to keep Unity
      because switching to C# now would be hell as I need to update the game quickly.
    • I understand that ads now require the latest API from Monetization 3.0.3, but I also see that Monetization 3.0.3 is supposed to support even Unity
    • I need to update the game without affecting the video ads functionality.
    How can I upgrade Unity Ads from the version I used in the apps that are on stores (
    "": "2.0.8"

    ) to leverage the current API? As you can see, I have tried lots of different things, but none of it seems to work.
  2. DenisasK


    Unity Technologies

    Oct 13, 2016
    Hello @momcil0 ,
    I will skip some details and will try to provide the action points.
    First of all, remove the Monetization 3.0.3(Asset Store) package from your project, afterward, disable Ads from Service Window.
    At this point, you will have a lot of compiler errors inside a Console Window. Open inside your project folder Packages/manifest.json and delete dependency. Reimport the project and import Monetization 3.0.3 from Asset Store again.
    Let me know if it will solve your issue.
  3. momcil0


    May 23, 2016
    Hello @DenisasK
    Thanks you for being so quick to respond. I believe that it could have went the way you suggested to go around the problem, because I did something similar (prior to seeing your response) and I managed to solve the problem. Just for the sake of diligence, I will compile the whole solution here, and just mention that I based my actions on this post.
    1. I disabled Ads from Services
    2. I removed the Ads package from the Package Manager. This step removed from the manifest.json as well.
    3. I just opened the contents of Monetization 3.0.3 and noted where it would place its files. Then I canceled import and first deleted manually all the files that were in places where Monetization 3.0.3 was about to place its files.
    4. I imported Monetization 3.0.3 from the Asset Store and there were no errors. The manifest.json file did not get updated, and I did not turn the Ads back on in Services - it seemed to work fine in Editor.
    5. In addition to that, I went through this article and made sure I replace all the instances of
      - that required adjusting other types and many other lines of code to solve ambiguities between what's in
    6. After the code worked in the Editor and I was able to successfully deploy it to an Android device, I turned the Ads back on in Services and turned off the built-in ads extension. It still worked and it appears it works now as well.
    Hope this helps.
  4. majacekic


    Jun 25, 2019
    Disabling and enabling Ads form Service worked for me. Thank you.
  5. JonnyHilly


    Sep 4, 2009
    tried various googled options, none worked or gave rise to other issues. fixed it by upgrading unity, removing old ads version and my ads code. updating to 2019.3 with latest unity-ads from package manager, and fresh implementation. now works. :) but a pain to get there.
    kr-unity likes this.