Unity Ads script Causing Builds To Fail? o.O

Hey all, my most recent project is nearing completion and now I would like to implement Unity ads the problem is doings so causes cloud build to fail, I noticed with ads turned on it builds fine but when I use the example code to show the ads it fails.

Here is the example script I’m using with 2 variables and of course the reward code, in the editor it works fine, no errors at all.
AdsManager Script

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Advertisements;

public class AdsManager : MonoBehaviour
{

    public int Bait;
    private BaitScoreManager bsm;

    public void ShowRewardedAd()
    {
        if (Advertisement.IsReady("rewardedVideo"))
        {
            var options = new ShowOptions { resultCallback = HandleShowResult };
            Advertisement.Show("rewardedVideo", options);
        }
    }

    private void HandleShowResult(ShowResult result)
    {
        switch (result)
        {
            case ShowResult.Finished:
                Debug.Log("The ad was successfully shown.");
                // Add 100 bait
                BaitScore.Add(Bait);
                bsm.UpdatedHS();
                break;
            case ShowResult.Skipped:
                Debug.Log("The ad was skipped before reaching the end.");
                break;
            case ShowResult.Failed:
                Debug.LogError("The ad failed to be shown.");
                break;
        }
    }
}

I can’t find any errors in the full build log but it does say “4547: [Unity] Player export failed. Reason: 2 errors”, I have no idea what’s going on.

EDIT: Ok guys, my problem was fixed the same as kazuki_kyakuno, update to path 5.5.0p3

Thanks,
Brian

Bump, still needing help with this…

Hello,

Can you please format your post as is shown in this post: Read this before posting - Unity Services - Unity Discussions

Thanks!

  • Sophia

I have the same problem. This is my log.
iOS build works fine. But Android build with Unity Ads doesn’t work.

Try the latest Unity 5.5 patch release, 5.5.0p3. We had a bug with the Android/IL2CPP Ads integration that was corrected in this version. I’m not entirely sure you are seeing the same issue, the 5.5.0f3 definitely won’t work. If 5.5.0p3 still does not work, please let us know, and we’ll try to track down the cause of the problem.

My problem was resolved at 5.5.0p3. Thanks.

Great, I’m glad to hear that!

This has also fixed my problem, I didn’t even notice this patch existed but after changing my target to use 5.5.0p3 it built and works fine on my device. :slight_smile: Thanks Josh, much love! <3

I’m glad to hear that your issue is corrected!