Banner ad through admob crashing app

I am trying to use a banner ad in my app and for some reason anytime I go to the scene where the ad is it displays a black screen.

heres my code for the ad

-- include ads library local ads = require("ads") local function adListener( event ) local msg = event.response if event.isError then -- Failed to receive an ad, we print the error message returned from the library. print(msg) end end ads.init("admob","ca-app-pub-9490367465204232/7991947832",adListener) ads.show( "banner", { x=0, y=0 } )

Have you looked in your console log for error messages?  If you don’t know how to do that, please read this tutorial:

http://coronalabs.com/blog/2013/07/09/tutorial-basic-debugging/

Thanks

Rob

Don’t quote me here but doesn’t the ads.init & your publisher code look strangely loonggggg. Mine are only about 15 or 16 characters long.

T.

Yeah, that’s an Ad Unit ID, which I don’t think will work.

Try using:
ads.init(“admob”,“ca-app-pub-9490367465204232”,adListener)

yeh I’m getting the following error and I’m not sure how to fix it

\<Warning\>: Runtime error ERROR: Could not load provider (admob) due to the following reason: module 'CoronaProvider.ads.admob' not found:resource (CoronaProvider.ads.admob.lu) does not exist in archive

check your plugin code- maybe your not including it .

T.

that was exactly the problem I wasn’t including it in build.settings  thanks for all the help everyone! this makes me like corona even more

Have you looked in your console log for error messages?  If you don’t know how to do that, please read this tutorial:

http://coronalabs.com/blog/2013/07/09/tutorial-basic-debugging/

Thanks

Rob

Don’t quote me here but doesn’t the ads.init & your publisher code look strangely loonggggg. Mine are only about 15 or 16 characters long.

T.

Yeah, that’s an Ad Unit ID, which I don’t think will work.

Try using:
ads.init(“admob”,“ca-app-pub-9490367465204232”,adListener)

yeh I’m getting the following error and I’m not sure how to fix it

\<Warning\>: Runtime error ERROR: Could not load provider (admob) due to the following reason: module 'CoronaProvider.ads.admob' not found:resource (CoronaProvider.ads.admob.lu) does not exist in archive

check your plugin code- maybe your not including it .

T.

that was exactly the problem I wasn’t including it in build.settings  thanks for all the help everyone! this makes me like corona even more