Search Unity

Advertisements not showing up in the release build

Discussion in 'Unity Ads & User Acquisition' started by roeland_w, Jan 12, 2017.

  1. roeland_w

    roeland_w

    Joined:
    Nov 2, 2016
    Posts:
    2
    So currently we are developing a game. We are running the latest Unity beta with the UnityAds imported from the services window. When i make an export and run the app through xCode everything works fine. The advertisements do get initialized properly. But whenever i archive the project and distribute it the Advertisement.isReady() always (and i mean always) returns false (i waited for around 2 days). This does not happen whenever i try to build it directly from xCode.

    It seems like there are some UnityAd network calls that are not being made in the "distributed" version of the app. but do work on the locally build version

    Does anyone know what the problem could be? im really banging my head against a wall right now.

    Tested on Beta 5.6.04 issue still persists
     
    Last edited: Jan 18, 2017
  2. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    Have you checked device log? You shouldsee something similar to following (our test project in this case):

    upload_2017-1-12_19-57-56.png
    Using https://lemonjar.com/iosconsole/ for accessing log in this case, you should also be able to access from Xcode.

    /Rasmus
     
  3. andrewmcglynn86

    andrewmcglynn86

    Joined:
    Dec 20, 2015
    Posts:
    47
    I'm seeing the same problem.
    I import the project to Xcode and run the project on my iPad. Unity Ads work fine in this case. I installed iosconsole and I filtered on unityads. There were loads of messages in the logs.

    The problem is after I export the game to an IPA file in Xcode and upload it to TestFlight. I attached iosconsole to the build from TestFlight on my iPad and there is no output from when filtering on unityads. I added some extra debug to my game and I can see that isInitialised is true but when isReady is called, it always returns false.

    I am using Unity 5.5.0p3 and Xcode 8.2.1 (8C1002).

    Any suggestions @rasmus-unity ?
     
  4. Tapgames

    Tapgames

    Joined:
    Dec 1, 2009
    Posts:
    242
    I have exactly the same issue, from xcode to the phone unity ads works perfectly after submitting to the app store unity ads no longer works.
     
  5. cvillena

    cvillena

    Joined:
    Aug 28, 2015
    Posts:
    6
    The same problem for unity 5.5.0 p4
     
    Tapgames likes this.
  6. Mogurito

    Mogurito

    Joined:
    Sep 21, 2015
    Posts:
    11
    That happens to me as well. Unity Ads works without problems when tested directly on xcode with the device connected by USB to the mac. But when uploaded to the store and tested with testflight the Ads doesn't work anymore.
     
  7. FritzH

    FritzH

    Developer Relations

    Joined:
    Aug 18, 2015
    Posts:
    45
    Hi Folks,

    We are looking into this issue right now. Some information about your builds would be extremely helpful:

    - Are these projects built through Cloudbuild or exported directly through the editor?
    - Which version of Unity & Xcode are you building from? (Unity 5.5.0p3?)
    - Please link your live app's App Store URL, or send a Testflight code to unityads-support@unity3d.com.
    - If possible, please include a console log (Window > Devices) of your debug build showing ads, and your live build failing to run ads.

    Thank you for your patience, we are working to resolve this as quickly as possible.
     
  8. andrewmcglynn86

    andrewmcglynn86

    Joined:
    Dec 20, 2015
    Posts:
    47
    Thanks @FritzH . I have sent all the information to the unityads-support team. The case is 82281
     
    FritzH likes this.
  9. teemukorh

    teemukorh

    Joined:
    Oct 28, 2014
    Posts:
    49
    I'm getting the following error in game performance. Using Unity 5.5.0p4.

    EntryPointNotFoundException: Unable to find an entry point named 'UnityAdsEngineSetReadyCallback' in '__InternalDynamic'.

    UnityEngine.Advertisements.iOS.Platform+unityAdsReady..ctor (System.Object object, IntPtr method)
     
  10. game5mobile

    game5mobile

    Joined:
    Sep 25, 2013
    Posts:
    3
    Hi,
    I have a workaround by disable builtin ads extension in the services window, then manually download Unity Ads 2.0.7 from Assets Store. I found that 5.5.0p4 builtin Unity Ads version is 2.0.6, so i guess 2.0.6 is the problem...
     
  11. andrewmcglynn86

    andrewmcglynn86

    Joined:
    Dec 20, 2015
    Posts:
    47
    @maxracoongames thanks for the workaround. I tested it out and it works for me too
     
    roeland_w and Tapgames like this.
  12. Sievlar

    Sievlar

    Joined:
    Oct 3, 2012
    Posts:
    68
    I had the same issue, switched back to Asset Store, but it did not work at all, until I remembered I needed to define UNITY_ADS, which does not seem to be defined for the Asset Store version.
     
  13. luckyboytm

    luckyboytm

    Joined:
    Dec 19, 2016
    Posts:
    2
    HI, how do you define UNITY_ADS?
     
  14. Sievlar

    Sievlar

    Joined:
    Oct 3, 2012
    Posts:
    68
    Go to "Edit -> Project Settings -> Player", then in the "Other Settings" section you will see "Scripting Define Symbols". Add "UNITY_ADS" to the end. Note the list is separated with semi colons ";"
     
  15. reefG

    reefG

    Joined:
    May 27, 2013
    Posts:
    11
    I also have the same issue, Ads are not served on a distribution (TestFlight) build. However if I build to a device (iPhone) Ads work!

    I'm using the Unity Ads Service.
     
    trizcorp likes this.
  16. RichCodes

    RichCodes

    Joined:
    Apr 3, 2013
    Posts:
    142

    1. Switch to Unity Ads 2.07 from the Asset Store (Credit: @maxracoongames )
    2. Go to "Edit -> Project Settings -> Player", then in the "Other Settings" section you will see "Scripting Define Symbols". Add "UNITY_ADS" to the end. Note the list is separated with semi colons ";" (Credit: @Sievlar )
    3. Initialize on Start()

    if UNITY_ANDROID
    Advertisement.Initialize("your id");
    #endif
    #if UNITY_IOS
    Advertisement.Initialize("your id");
    #endif

    (Credit: @VictorCashDaShi )


    All three of these together has worked in three separate projects now.
     
    hippogames likes this.
  17. reefG

    reefG

    Joined:
    May 27, 2013
    Posts:
    11
    Thanks for the workaround - just to add, the services approach still doesn't work in 5.5.1p1
     
    Plucky likes this.
  18. Ravshan

    Ravshan

    Joined:
    Apr 20, 2015
    Posts:
    3
    Unity 5.6.0b6 Xcode 8.2.1
    unity ads doesn't work on test flight, from Xcode it works perfectly.
    When are you planning to fix this bug?
    thank you in advance
     
    Nwafefe and ant141110 like this.
  19. vexeda-inc

    vexeda-inc

    Joined:
    Feb 18, 2017
    Posts:
    1
    Hi FritzH,
    Any update on this thread?
    Thank you.
     
  20. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    The issue with Ads code being stripped in iOS .ipa builds in Unity 5.5.1 has been fixed in Unity 5.5.2. Have you upgraded? Also works in 5.6.0f1, which I have used for submitting game to Apple App Store.

    /Rasmus
     
  21. lugduweb

    lugduweb

    Joined:
    Mar 2, 2014
    Posts:
    50
    Hello, I have the Unity Ads service problem with Unity 5.6.0f3 on Mac OSX for Android target.
    I've tried the following workarounds: enable/disable the service and restart. Adding UNiTY_ADS define in my script (but then no ads are shown when I play in editor).
    I haven't tried RichCodes workaround, but as it is supposed to be fixed since 5.5.2 are there any hints for 5.6.0 ?
    Thanks
     
  22. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    Please ensure that your ProjectSettings/UnityConnectSettings.asset file contains following:
    /Rasmus
     
  23. lugduweb

    lugduweb

    Joined:
    Mar 2, 2014
    Posts:
    50
    Hello, thanks for help. It now works.
    I've also changed the script (from Awake/start) for a later call into an update method because it seems that it is not ready until a few play cycles.
     
  24. LevPewPew

    LevPewPew

    Joined:
    May 3, 2017
    Posts:
    3
    Hi Rasmus,

    How do I actually open/edit a .asset file?

    I am using OS X, and with Visual Studio Code I receive the error "The file will not be displayed in the editor because it is either binary, very large or uses an unsupported text encoding.

    I can't try use MonoDevelop as it is greyed out in the "Open with..." menu.

    I tried some googling for other options but couldn't find anything.
     
  25. LevPewPew

    LevPewPew

    Joined:
    May 3, 2017
    Posts:
    3
    Bump. Still haven't figured this one out :(
     
  26. LevPewPew

    LevPewPew

    Joined:
    May 3, 2017
    Posts:
    3
    I haven't figured out my above problem specifically, i.e. opening and editing an .asset file, however I have now fixed my issues with Unity Ads, see below for anyone else with same problems:

    - I downloaded Unity Ads through the asset store and imported that asset (even though I am not meant to have to as I am using Unity 5.5).
    - I kept Unity Ads turned on in the Services panel as well as enable built-in app extention ticked (I'm not sure if this is essential but I haven't bothered to tinker with this step).
    - Ads would not play when using Advertisement.Show() even after waiting for a long time, i.e. the ad was not prepared in any way, in order to force my app to do this in Start() I placed Advertisement.Initialize(androidGameID);
     
    cstlmode and powt33pda like this.
  27. cstlmode

    cstlmode

    Joined:
    Dec 2, 2014
    Posts:
    88
    me too can't find how to open that file and edit it ,
     
  28. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    @cstlmode, probably easiest for you to use our Asset Store version instead. Disable engine integrated ads by removing checkmark from "Enable builtin Ads extension" option in Ads Services window:

    upload_2017-6-24_9-56-6.png

    And then use asset store package from https://www.assetstore.unity3d.com/en/#!/content/66123. Let us know if that works for you.

    /Rasmus
     
    Last edited: Jun 25, 2017
  29. cstlmode

    cstlmode

    Joined:
    Dec 2, 2014
    Posts:
    88
    @rasmus-unity thanx a lot for your answer , i found out how to modify UnityConnectSettings.asset , and things are working fine now ,
     
  30. Zape

    Zape

    Joined:
    Jun 12, 2013
    Posts:
    33
    Hi!
    How did you did it? I tried but I'm having parsing problems.
    Thanks
     
  31. cstlmode

    cstlmode

    Joined:
    Dec 2, 2014
    Posts:
    88
    @Zape hello go to Edit > projectSettings>Editor > asset serialization then chose Force text ,
    after that drag and drop UnityConnectSettings.asset in visual studio , it will open like charm
    PS changing asset serialization is not recommended ,you need to backup your project before doing that , it screwed all the string fields i have in the project , it got converted to hex code , most of them but not all .
     
  32. tataygames

    tataygames

    Joined:
    Aug 4, 2016
    Posts:
    55
    Lol I never thought it will be this hard implementing the new unity ads 3.0,
    lots of bugs, tried everything you guys sed.
    vungle, admob and applovin, plugin works no problem to me, and this ads made by unity itself is not working lol
     
  33. bbddkksarkar

    bbddkksarkar

    Joined:
    Apr 12, 2019
    Posts:
    1
    any one got the solution please help meeeee.......
     
  34. SH0N0

    SH0N0

    Joined:
    Jul 22, 2020
    Posts:
    2
    help guys pls

    im having same problem:

    error CS0103: The name 'Advertisement' does not exist in the current context
     
  35. SH0N0

    SH0N0

    Joined:
    Jul 22, 2020
    Posts:
    2
    i tried everything you guys said but can't fix the problem
     
  36. ickydime

    ickydime

    Joined:
    Nov 20, 2012
    Posts:
    110
    For me I was using an asmdef file/folder that was referencing the ad package so I needed to add that reference to my asmdef instance.