• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by nabajit_ · Dec 23, 2017 at 08:12 AM · unity ads

Unity ad is not supported when build for android?

CODE:

 using UnityEngine;
 using UnityEngine.Advertisements;
 using UnityEngine.UI;
 public class AdManager : MonoBehaviour {
 
     public string adId = ".........";
     public Text txt;
     
     void Start () {
         DontDestroyOnLoad (this.gameObject);
         if (!Advertisement.isSupported) {
             txt.text = "not supported";
             return;
         }
         if (!Advertisement.isInitialized) {
             Advertisement.Initialize (adId, false);
 
         } else {
             return;
         }
         StartCoroutine (isAdReady ());
     }
 
     IEnumerator isAdReady(){
         while (!Advertisement.IsReady ()) {
             txt.text = "not ready";
             yield return null;
         }
         txt.text = "ready";
     
     }

In editor it shows that the ad is ready to display, But when I build for android it says the ads are not supported. And also there is an error when I run the game as (line 16):

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

Which is on the line where I initialize the ad. This maybe reason for not supporting the ads. Somebody please explain how to solve the issue?

picture of the error inside editor: image

picture of the script look the line 22 where editor shows the error alt text

Unity version: 2017.2.0f3

2.jpg (133.4 kB)
1.jpg (128.2 kB)
Comment
Add comment · Show 8
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image pako · Dec 23, 2017 at 09:09 AM 0
Share

You must not ask two questions in the same post, or your question may be rejected/closed.

I suggest that you edit your question, and remove the second part about the $$anonymous$$issing$$anonymous$$ethodException, and post it in a separate question.

Read the FAQ to learn how to post good questions.

avatar image nabajit_ pako · Dec 23, 2017 at 09:48 AM 0
Share

I add it because I think this error is related to not supporting the ads because it's on the line where I initialize the ad

avatar image pako nabajit_ · Dec 23, 2017 at 10:07 AM 0
Share

If line numbers are important you should include them.

So, you are saying that line 16 Advertisement.Initialize (adId, false); is throwing the exception "$$anonymous$$issing$$anonymous$$ethodException: $$anonymous$$ethod not found: 'UnityEngine.Texture2D.LoadImage'?

This is confusing! The error message is saying that you are calling the method Texture2D.LoadImage() which BTW has been deprecated in Unity v.2017.x.

I don't see in the code you have posted ANY calls to Texture2D.LoadImage(), in line 16 or anywhere else. This is why I have considered these as separate questions.

Please clarify.

Show more comments
avatar image David_Farina_BR · Dec 24, 2017 at 01:38 PM 0
Share

Hi, out of your question, but only to you know.

the correct is achievements not acivements

:)

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by pako · Dec 23, 2017 at 01:53 PM

According to the log, when you initialize the Advertisements Advertisements.Advertisement.Initialize() gets called, which in turn, calls Advertisements.Editor.Placeholder.Awake(), and then, inside that Awake(), a call is made to Texture2D.LoadImage(), which is invalid for Unity version 2017.2.0f3.

You must update the Unity Ads plugin. If you are using the internal (integrated) version of Unity Ads, just open the "Services" Window in Unity, and click on "Ads". If you are using the Asset Store version of Unity Ads, then import the latest version from the Asset Store.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image nabajit_ · Dec 23, 2017 at 06:15 PM 1
Share

Thanks for your support finally got this to work

avatar image
0

Answer by hark313 · Aug 25, 2018 at 11:04 AM

From Unity 2017.0.x MissingMethodException: Method not found: 'UnityEngine.Texture2D.LoadImage' is not supporting plz delete unity folder and update from link: **https://assetstore.unity.com/packages/add-ons/services/unity-ads-66123**

This solved for my project.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

73 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Problem with Unity Ads 1 Answer

Why does my Xcode give me these errors?? 0 Answers

unity ads paying very low money with very less eCPM 0 Answers

Does unity credit skipped ads? 0 Answers

'This organization has been suspended' unity ads not showing 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges