Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Crash when loading iAds

I've got the following code running to create and iAds AdView:

if (parseFloat(Ti.Platform.version) >= 4.0) {
            var adView = Ti.UI.iOS.createAdView({
                width: 'auto',
                height: 'auto',
                top: -100,
                borderColor: '#000000',
                backgroundColor: '#000000'
            });
            win.add(adView);
        }

I'm getting the following error:

Result of expression 'Ti.UI.iOS.createAdView' [undefined] is not a function'...

It doesn't happen all the time though, sometimes I see the test ad as expected.

Any ideas on why this is happening? I'm checking for the right iOS version. (In fact, isn't iAds supported in 3.2?)

— asked September 30th 2010 by Charles Davison
  • createadview
  • iads
  • iphone
2 Comments
  • I'm using iOS 4.1 and Ti 1.4

    — commented September 30th 2010 by Charles Davison
  • I have the same problem. TI SDK 1.5.1 and iOS SDK 4.2. Any solution?

    — commented January 5th 2011 by Magnus Ottosson

3 Answers

  • Delete the build folder and it should work! Solved the problem for me!

    — answered January 5th 2011 by Magnus Ottosson
    permalink
    0 Comments
  • iOS/Ti SDK?

    — answered September 30th 2010 by Daniel Lim
    permalink
    0 Comments
  • Deleting the BUILD folder and then rebuilding worked for me as well.

    — answered February 4th 2012 by Eric Soto
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.