Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug Advertisments Package 4.3.0 breaks Unity Cloud Build

Discussion in 'Unity Ads & User Acquisition' started by arcandio, Aug 23, 2022.

  1. arcandio

    arcandio

    Joined:
    Aug 30, 2009
    Posts:
    89
    I'm working on a cross-platform android/ios app for a paying client. I build my app on UCB. I have unit tests, so my UCB builds are configured to run tests. I don't want to release buggy software, so my UCB builds are configured to fail if unit tests fail.

    All's well so far.

    Recently, Google notified me that the old (3.x.x?) version of com.unity3d.ads:unity-ads collects sensitive data and that I would have to upgrade to 4.0.1.

    So I naturally upgraded and wrangled with the changes to the API until it worked. When I submitted my working build to UCB via git, I got an error in UCB relating to the Advertisements package that didn't show up locally. This error causes my build to fail, even though none of my unit tests have actually failed.

    I had a look, and this file exists in the package, not my code. It also exists in 4.3.0, not just 4.2.1. The above mentioned 'Placeholder.cs' file provided by Unity's package manager contains obsolete code, and thus breaks my builds.

    It looks like a very simple fix, simply changing line 83 from

    Code (CSharp):
    1. if (m_CurrentScreenOrientation == ScreenOrientation.Landscape)
    to something like
    Code (CSharp):
    1. if (m_CurrentScreenOrientation == ScreenOrientation.LandscapeLeft || m_CurrentScreenOrientation == ScreenOrientation.LandscapeRight)
    But unfortunately, I don't think I can do anything about it. The class is inside a unity Package Manager package provided by Unity, and I don't think I can override it in any way, because if I change the contents of the file locally, the remote UCB will probably just download the package directly when building and ignore my changes.

    Are there any other ways to fix this problem? My client is waiting for a new build.
     
    Last edited: Aug 23, 2022
  2. arcandio

    arcandio

    Joined:
    Aug 30, 2009
    Posts:
    89
    Ideally, there would be a new version of Unity Advertisements on Package Manager soon that incorporates any changes needed for UCB, but that would require changes to the Package by whatever team is in charge of Unity Advertisements.
     
  3. arcandio

    arcandio

    Joined:
    Aug 30, 2009
    Posts:
    89
    And I did verify that this file is in the package manager, not my code, by creating a new project, installing Unity Advertisments 4.3.0 and finding the bug on line 83 in that project as well.
     
    Last edited: Aug 23, 2022
  4. arcandio

    arcandio

    Joined:
    Aug 30, 2009
    Posts:
    89
    I'm on Unity version 2021.2.0b16 (edbc0738c91b) if that's useful.
     
  5. arcandio

    arcandio

    Joined:
    Aug 30, 2009
    Posts:
    89
  6. arcandio

    arcandio

    Joined:
    Aug 30, 2009
    Posts:
    89
    I experimented with adding the change to my local version, but I was right, the package cache is not stored in a normal git repo for unity. Since the problem is never produced locally, this isn't useful for fixing the problem.
     
  7. arcandio

    arcandio

    Joined:
    Aug 30, 2009
    Posts:
    89
    Here's the other thing, why is Placeholder.cs even being used on an android build? It's kept in the Editor folder of the plugin, causing me to believe that it's related to placeholder ads shown in the editor, not real ads shown on android.
     
  8. arcandio

    arcandio

    Joined:
    Aug 30, 2009
    Posts:
    89
    This repo is clearly for the adroid/java ads implementation, not the unity C# one. I can't find the correct C# repo, I assume it's private.
     
  9. arcandio

    arcandio

    Joined:
    Aug 30, 2009
    Posts:
    89
    I built a blank project and added Unity Ads to it in order to send the project and instructions to unity support as a bug.
     
  10. arcandio

    arcandio

    Joined:
    Aug 30, 2009
    Posts:
    89
    Now, conveniently, I can't access Jira to view the bug report.

    this has become a devlog.
     
  11. arcandio

    arcandio

    Joined:
    Aug 30, 2009
    Posts:
    89
    How do you report a bug with the bug reporting system?
     
  12. arcandio

    arcandio

    Joined:
    Aug 30, 2009
    Posts:
    89
    To clarify, I built a simple repro project and submitted the bug to Unity through the Editor. Some time later I got an email about my bug. It directs me to a Jira incident, IN-14807. When I try to log into Jira, it simply tells me that I'm not authorized to view this portal. No further information is given. My bug submission went into a black hole.

    This has been extraordinarily frustrating. So far I have received ZERO support from Unity over a mission-critical bug that is definitely Unity's fault. Not even so much as a word.

    I don't understand why I'm getting radio silence on this. Is the answer so obvious that it's not worth the time to type a single reply? Is it a Somebody Else's Problem? And if so, who? Wrong forum? Which?

    And if the answer is simply: "Don't test on UCB," then that just seems like an insane idea for a production app.
     
  13. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    678
    Landscape is not deprecated in 2020 (only Unknown is) but maybe that's a 2021 thing? (I'm using 2020, not 2021)

    If it is then yes, I would say that's a Unity bug. I'm surprised they haven't commented, as it's quite obvious if that's the case.

    I wasn't aware that deprecations cause UCB to error (fail) though. They should be warnings (not fails) so maybe that's a configurable thing that you could change? (until Unity fix the issue)
     
    Last edited: Aug 30, 2022
    arcandio likes this.
  14. arcandio

    arcandio

    Joined:
    Aug 30, 2009
    Posts:
    89
    I did apparently have UCB building on latest, so I'm checking to see if setting it specifically to my dev editor version remedies that.

    As for the warning becoming an error, I don't see any configuration options for that. The only UCB config options for testing are
    • Run my project’s unit tests when building
    • Run PlayMode tests
    • Run EditMode tests
    • Mark build as failed if any test fails
    I didn't realize that the editor version was what was determining the deprecations of the package manager content. I suppose that means that newer versions of Unity are incompatible with newer versions of the Advertisements package? Thus meaning that I should try moving forward on Unity 2020 + Advertisemens 4.30 => Google Play?

    God, I hope there aren't any similar version requirements for iOS otherwise I'm definitely going to end up stuck.
     
    PeachyPixels likes this.
  15. arcandio

    arcandio

    Joined:
    Aug 30, 2009
    Posts:
    89
    And THANK YOU
     
    PeachyPixels likes this.
  16. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    678
    I wouldn't say incompatible, rather it may show deprecation warnings. But this is the first time I've heard of a deprecation failing a build. It might be worth posting in the UCB about that.

    I'm using 2020.LTS and all the latest UGS packages on both iOS & Android without any issues (built with UCB)

    I'm holding off on 2021.LTS for now as I've seen numerous issues reported with it. Hopefully in 3-6 months it'll be more mature\stable.

    Good luck anyway, hopefully that'll help you get back on track (even if it's only a workaround)
     
  17. sbankhead

    sbankhead

    Unity Technologies

    Joined:
    Jul 27, 2014
    Posts:
    97
    Just a heads up that the above issue is a warning only and should not break your build unless you have something like fail my build if you detect any warnings on. It has been fixed in the latest release (4.4.0) which should be releasing next week. Apologies for any confusion this may have caused you.
     
  18. arcandio

    arcandio

    Joined:
    Aug 30, 2009
    Posts:
    89
    I've never seen an option called "fail my build if you detect any warnings" in UCB, but I'll wait until 4.4.0 to see if I can get this to work.

    It looks to me like there's a relatively simple regex running on each line in the full log to see if it counts as an error on UCB, because it seems to highlight any call that has the word "error" in it, even it's not actually receiving an error. But I don't know how that whole system works.
     
  19. Multiscription_Uffe

    Multiscription_Uffe

    Joined:
    May 2, 2022
    Posts:
    16
    I have the exact same problem as @arcandio. Even though this is just supposed to be a warning, it DOES fail our builds on Unity Cloud Build. You can read about it in my post here: https://forum.unity.com/threads/facebook-sdk-fails-due-to-cs0619-errors.1342538/#post-8480567

    Do you know when version 4.4.0 of the Ads SDK is coming out?

    Thank you very much in advance.
     
  20. Unity_Adamski

    Unity_Adamski

    Unity Technologies

    Joined:
    Jul 20, 2020
    Posts:
    110
    @Multiscription the 4.4.0 version of the SDK is already out for both Android and iOS. However, the Unity Package should be available sometime later this week.
     
  21. Multiscription_Uffe

    Multiscription_Uffe

    Joined:
    May 2, 2022
    Posts:
    16
    Thanks! Looking forward to it. Will test it as soon as it's available.
     
  22. RoKetX

    RoKetX

    Joined:
    May 10, 2018
    Posts:
    8
    Still waiting on this :\
     
  23. Multiscription_Uffe

    Multiscription_Uffe

    Joined:
    May 2, 2022
    Posts:
    16
    I'm using 4.4.1 here (together with Unity 2020.3 LTS), and it has been available to me for several weeks now. It's not "Verified" yet though.
     
  24. Yasuyuki

    Yasuyuki

    Unity Technologies

    Joined:
    Sep 11, 2014
    Posts:
    90
    The latest Unity Ads package can be installed from Project Settings window:


    Or you can modify Packages/manifest.json directly like this:
     
    nightqnearth likes this.