Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
1
Question by Andrey Verbin · Oct 26, 2010 at 06:22 AM · bugiphoneunityiphone

Unity 3 crash when I link with AdMob or AdSense

Hi,

Have anybody successfully integrated Google AdSense or AdMob with Unity3D 3 game?

My game worked flawlessly with Unity 2, but when I ported it to Unity 3 my game started to crash at startup unless I remove all ads except iAd. The problem is really weird - game crashes at random places when I link(!!!) with AdMob or AdSense libraries. The minimal configuration to trigger this crash is to link with AdMob or AdSense, put a reference to a constant or a class from these libraries somewhere in Objective C code (inside a bundle code or inside AppController) and have a script inside a scene with a reference to GUI.color. This is a pseudo code to demonstrate this situation.

AppController.m


#import "GADAdViewController.h"
...
-(void)applicationDidFinishLaunching:(UIApplication)app { //it does not matter where below line is located. It can be placed in main.mm or anywhere else as well.
....
adViewController_ = [[GADAdViewController alloc] initWithDelegate:self];
....
} 

Inside Unity script


public class Test {
  public void Awake() {
     GUI.color = Color.red;   //this code does not have to run. Having reference to GUI.color is enough.
  }
}

This code does not even have to run! Having references to symbols from these static libs and a call to GUI.color is enough to make unity crash on startup at random places. My best guess is that this have something to do with static initialization or loading of Unity classes.

What I already did

  1. Tried to compile with GCC and LLVM without any optimizations - same results.
  2. Verified that removing either reference to GADAdViewController or GUI.color fixing the issue.
  3. Created a game from scratch, added these two lines and verified that the problem persists.

Please help, I'm running our of options to try and cannot understand what is going on.

Comment
Add comment · Show 4
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 SoundGuy32 · Dec 05, 2010 at 08:19 AM 0
Share

I'm having exactly the same problem. Any luck so far?

avatar image Argenex · Mar 22, 2011 at 01:33 AM 0
Share

Is there any resolution to this? I'm having a hard time finding anything anywhere showing how to impliment google ads, admob, and adsense into your unity app.

avatar image Argenex · Mar 22, 2011 at 04:48 AM 0
Share

http://forum.unity3d.com/threads/77568-Ad$$anonymous$$ob-plugin-that-works-in-Unity-3.2

But unfortunatly you get a Force Close due to a class not found.

avatar image thomasw · Jun 06, 2011 at 01:44 AM 0
Share

Could you post a backtrace of your crash?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by PolityAI · Jun 05, 2012 at 12:17 PM

I've written plugins to integrate both AdMob and Mobclix. The Mobclix one is currently free, please find more details at link text

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

2 People are following this question.

avatar image avatar image

Related Questions

Unity IL2CPP 0 Answers

HUGE Texture problems on iPhone when using animated UVs 2 Answers

Recognize that user call somebody & local notification 0 Answers

How to embed unity ios project with another ios project 0 Answers

Unable to load Unity iPhone examples as scenes 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