Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug When I try to Load an Ad it shows this an error that says cannot generate sprite texture.

Discussion in 'Unity Ads & User Acquisition' started by Div_Sharp, May 20, 2022.

  1. Div_Sharp

    Div_Sharp

    Joined:
    Jun 18, 2020
    Posts:
    3
    Well I get the following error when I load the Scene:
    ArgumentException: Could not create sprite (0, 0, 1600, 1200) from a 256x192 texture.
    UnityEngine.Sprite.Create (UnityEngine.Texture2D texture, UnityEngine.Rect rect, UnityEngine.Vector2 pivot, System.Single pixelsPerUnit, System.UInt32 extrude, UnityEngine.SpriteMeshType meshType, UnityEngine.Vector4 border, System.Boolean generateFallbackPhysicsShape) (at <1332c534a8a44623b2e5cc943a0b790e>:0)
    UnityEngine.Sprite.Create (UnityEngine.Texture2D texture, UnityEngine.Rect rect, UnityEngine.Vector2 pivot, System.Single pixelsPerUnit, System.UInt32 extrude, UnityEngine.SpriteMeshType meshType, UnityEngine.Vector4 border) (at <1332c534a8a44623b2e5cc943a0b790e>:0)
    UnityEngine.Sprite.Create (UnityEngine.Texture2D texture, UnityEngine.Rect rect, UnityEngine.Vector2 pivot, System.Single pixelsPerUnit, System.UInt32 extrude, UnityEngine.SpriteMeshType meshType) (at <1332c534a8a44623b2e5cc943a0b790e>:0)
    UnityEngine.Sprite.Create (UnityEngine.Texture2D texture, UnityEngine.Rect rect, UnityEngine.Vector2 pivot, System.Single pixelsPerUnit, System.UInt32 extrude) (at <1332c534a8a44623b2e5cc943a0b790e>:0)
    UnityEngine.Sprite.Create (UnityEngine.Texture2D texture, UnityEngine.Rect rect, UnityEngine.Vector2 pivot, System.Single pixelsPerUnit) (at <1332c534a8a44623b2e5cc943a0b790e>:0)
    UnityEngine.Sprite.Create (UnityEngine.Texture2D texture, UnityEngine.Rect rect, UnityEngine.Vector2 pivot) (at <1332c534a8a44623b2e5cc943a0b790e>:0)
    UnityEngine.Advertisements.Placeholder.CreateImage (UnityEngine.GameObject canvasGameObject, UnityEngine.Texture2D texture, System.Int32 width, System.Int32 height) (at Library/PackageCache/com.unity.ads@3.7.5/Runtime/Advertisement/Platform/Editor/Placeholder.cs:172)
    UnityEngine.Advertisements.Placeholder.CreatePlaceholder (UnityEngine.GameObject canvasGameObject, UnityEngine.Texture2D texture, System.Int32 textureWidth, System.Int32 textureHeight) (at Library/PackageCache/com.unity.ads@3.7.5/Runtime/Advertisement/Platform/Editor/Placeholder.cs:120)
    UnityEngine.Advertisements.Placeholder.Awake () (at Library/PackageCache/com.unity.ads@3.7.5/Runtime/Advertisement/Platform/Editor/Placeholder.cs:37)
    UnityEngine.Advertisements.Advertisement:Initialize(String, Boolean)
    Monetization:Start() (at Assets/Code/Monetization.cs:13)​

    And when I try to Show Ads it says:
    NullReferenceException: Object reference not set to an instance of an object
    UnityEngine.Advertisements.Placeholder.ShowSkipButton (UnityEngine.GameObject canvasGameObject) (at Library/PackageCache/com.unity.ads@3.7.5/Runtime/Advertisement/Platform/Editor/Placeholder.cs:184)
    UnityEngine.Advertisements.Placeholder.Show (System.String placementId, System.Boolean allowSkip) (at Library/PackageCache/com.unity.ads@3.7.5/Runtime/Advertisement/Platform/Editor/Placeholder.cs:75)
    UnityEngine.Advertisements.Platform.Editor.EditorPlatform+<>c__DisplayClass15_0.<Show>b__0 () (at Library/PackageCache/com.unity.ads@3.7.5/Runtime/Advertisement/Platform/Editor/EditorPlatform.cs:188)
    UnityEngine.Advertisements.Utilities.CoroutineExecutor.Update () (at Library/PackageCache/com.unity.ads@3.7.5/Runtime/Advertisement/Utilities/CoroutineExecutor.cs:17)
     
  2. RomanB205

    RomanB205

    Joined:
    Jun 24, 2015
    Posts:
    5
    Same here, bumping the thread
     
  3. Unity-Boon

    Unity-Boon

    Unity Technologies

    Joined:
    Jan 18, 2017
    Posts:
    135
    Can you try upgrade the Unity Ads SDK to the latest version? Google Play Store will require version 4.0.1 or above for new submission
     
  4. valerypopov

    valerypopov

    Joined:
    Mar 27, 2020
    Posts:
    3
    In Build Settings set Max Texture Size - No override and click Apply button
     
  5. xainulabdeen

    xainulabdeen

    Joined:
    Apr 10, 2018
    Posts:
    5
    Go to Assets/Editor/Resources there should be demo images for unity ads Like (portrad ad, landscape ad) see if these are missing .. If not missing then make sure there compression format is set to default . that solved my problem
     
  6. illicit-technics

    illicit-technics

    Joined:
    Sep 22, 2022
    Posts:
    1
    i think i love you. THANKS!