Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • 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 /
  • Help Room /
avatar image
0
Question by pir4t94 · Jan 25, 2016 at 02:16 AM · unity 5admob

game crashes when calling RequestBanner() AdMob

Hello!

I'm making a 2d game in unity and I want to have AdMob banner in my game. So I did everything like it says here: https://developers.google.com/admob/android/games , when I try to run game in Unity Editor it's not showing ads, but everything else is working even log says: Created Dummy Client, Dummy CreateBannerView, Dummy LoadAd (so i guess ads are working) but when i run the game on phone game crashes right after calling RequestBanner() i'm guessing it crashes on bannerView.LoadAd(request);

Here's my RequestBanner function: private void RequestBanner() { // Create a 320x50 banner at the top of the screen. bannerView = new BannerView("ca-app-pub-2895386526091671/9071811144", AdSize.Banner, AdPosition.Top); // Create an empty ad request. request = new AdRequest.Builder().Build(); // Load the banner with the request. bannerView.LoadAd(request); }

I tried many thing but nothing is working for me so please help me.

Comment
Add comment
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

3 Replies

· Add your reply
  • Sort: 
avatar image
3

Answer by GameEverything · Sep 16, 2016 at 08:41 AM

I had this issue for a bit where it was off and on with the AdMob ads and my ads were running on Awake, so I consolidated all of the ad code into an IEnumator ShowBanner function and then added a yield statement with 5 seconds as a parameter before the AdMob code.

I wonder if this is what science is because I totally didn't expect this solution to work, lol.

To wrap up, if you're running your code on Awake or on Start right when you first run your game, try adding some time in between the calling of the function and initialization. My guess is that there was stuff loading at the same time as AdMob that AdMob needs which causes it to crash.

Anyhoo, good luck.

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 LKSFX · Jun 29, 2018 at 05:44 PM 0
Share

That's right, it solves the problem for me.

avatar image
0

Answer by VirtualCastle · Apr 21, 2016 at 11:08 PM

I'm having the same problem... @pir4t94,I'm having the same problem...

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
avatar image
0

Answer by daothang · Sep 16, 2016 at 02:54 PM

Fix Admob with unity 5 :https://www.youtube.com/watch?v=A8-VCYNByls

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.

Follow this Question

Answers Answers and Comments

54 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

Related Questions

Hi Everyone Please help me with Unity And Admob integration 0 Answers

AndroidJavaException: java.lang.ClassNotFoundException: com.google.unity.ads.UnityInterstitialAdCallback 1 Answer

Rewardedvideo ad admob how to add the reward 0 Answers

How to display ads every 5 mins ? 1 Answer

Implement Google Play Services after implementing Google ADMOB 0 Answers


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