Search Unity

Initialize Unity ads error

Discussion in 'Unity Ads & User Acquisition' started by Hercull, Nov 8, 2017.

Thread Status:
Not open for further replies.
  1. Hercull

    Hercull

    Joined:
    Aug 28, 2017
    Posts:
    42
    Hi Guys,

    I want to implement Unity ads on my first game .
    I download the SDK from AssetStore.
    When i launch Initialize:

    Advertisement.Initialize (gameId, true);

    i got this error:

    MissingMethodException: Method not found: 'UnityEngine.Texture2D.LoadImage'.

    TY for your help.

    my code:

    #if UNITY_IOS
    string gameId = "xxx";
    #elif UNITY_ANDROID
    string gameId = "xxx";
    #endif

    if (Advertisement.isSupported) {
    Advertisement.Initialize (gameId, true);
    }

    if (Advertisement.IsReady ()) {
    Advertisement.Show ();
    }

    PS i checked "Enable Test mod" on Services panel.
     
  2. mikaisomaa

    mikaisomaa

    Unity Technologies

    Joined:
    Sep 14, 2015
    Posts:
    365
    Hi,

    Thanks for bringing this up!

    Which version of the editor are you using? Have you tried reimporting your assets?

    Also: I recommend integrating Ads to your project only from the Asset Store right now and disabling Ads from the Services -window altogether.
     
  3. Hercull

    Hercull

    Joined:
    Aug 28, 2017
    Posts:
    42
    Hi,

    My Version is 2017.2.0f3 64 bits.

    With this Version i need to import SDK from AssetStore or its useless?

    I have re-importing 2 times and got the same error.

    For now i cant use Unity Ads, say me what can i do.

    TY
     
    Last edited: Nov 8, 2017
  4. mikaisomaa

    mikaisomaa

    Unity Technologies

    Joined:
    Sep 14, 2015
    Posts:
    365
    egowall-llc likes this.
  5. Hercull

    Hercull

    Joined:
    Aug 28, 2017
    Posts:
    42
    Yes i have disabled Ads from the Services Window.

    I dont have this line: m_EnabledPlatforms: 4294967295 on my ProjectSettings/UnityConnectSettings.asset

    should I add it manually?

    my m_InitializeOnStartup was already 1.

    With the Version 2017.2.0f3 64 bits i need to import SDK from AssetStore or its useless?
     
  6. mikaisomaa

    mikaisomaa

    Unity Technologies

    Joined:
    Sep 14, 2015
    Posts:
    365
    Hi,

    The UnityConnectSettings.asset -configuration file is relevant for integrations from the Services -window - let's try to go with updating Ads from Asset Store and using only that.
     
  7. Hercull

    Hercull

    Joined:
    Aug 28, 2017
    Posts:
    42
    Hi,

    Ok, i just create a new empty project, i import UnityAds from assetStore and put the simple code:

    using UnityEngine.Advertisements;

    void Start () {
    UnityAdsRequestInterstitial();
    }

    private void UnityAdsRequestInterstitial()
    {
    #if UNITY_IOS
    string gameId = "xxx";
    #elif UNITY_ANDROID
    string gameId = "xxx";
    #endif

    if (Advertisement.isSupported) {
    Advertisement.Initialize (gameId , true);
    }

    if (Advertisement.IsReady ()) {
    Advertisement.Show ();
    }
    }

    I got the same error.

    So its not my project , it can be the Version of the Unity with the UnityAds from assetStore.

    You can try on your computer, create new project import UnityAds from assetStore et use this code you will got the same error.

    TY
     
  8. kanzariyahitesh405

    kanzariyahitesh405

    Joined:
    Sep 18, 2019
    Posts:
    5
    i found issue.
    test ads does not show.

    Error :- Unity Ads show failed: Webapp timeout, shutting down Unity Ads
    final UnityAdsListener myAdsListener = new UnityAdsListener();
    UnityAds.initialize(this, MyApplication.getApplicationInstance().getupguintru(), myAdsListener, true);

    private class UnityAdsListener implements IUnityAdsListener {

    public void onUnityAdsReady(String placementId) {

    }

    @override
    public void onUnityAdsStart(String placementId) {
    }

    @override
    public void onUnityAdsFinish(String placementId, UnityAds.FinishState finishState) {
    }

    @override
    public void onUnityAdsError(UnityAds.UnityAdsError error, String message) {

    }
    }

    if (UnityAds.isReady("video")) {
    UnityAds.show(LuckyBox.this, "video");
    }
     
Thread Status:
Not open for further replies.