Warning for admob build.settings

Hello people,

WARNING: CoronaProvider.ads.admob is not configured in build.settings WARNING: The ‘ads’ provider (admob) is not available on the simulator

I followed this tutorial https://coronalabs.com/blog/2014/07/15/tutorial-implementing-admob-v2/ for implementing admob. 

This is code on build.settings

settings = { orientation = { default = "portrait", }, plugins =     {        ["plugin.google.play.services"] =         {             publisherId = "com.coronalabs",             supportedPlatforms = { iphone=true, android=true }         },                   ["CoronaProvider.gameNetwork.apple"] =         {             publisherId = "com.coronalabs",             supportedPlatforms = { iphone=true }         },     }, }

Why is that error?

And of course, I have the same error for gameCenter. Error told me that I didn’t implement plugin on build.settings what is really big lie.

Thanks and kind regards

First of all they are warnings. You cannot use AdMob in the simulator. You must test on a device to test with it. There is a stub plugin that loads in the sim that issues the warning and lets your ads.* calls run without causing errors.

Rob

Hello Rob, 

I builded game on device and corona simulator console recieved these errors: 
1.[Device] ERROR: Runtime error
2.[Device] Runtime Error: Runtime error: /Users/xxx/Documents/TestingGame/restart.lua:94: attempt to index global ‘ads’ (a nil value)

My build.setting look like on my first post.

main.lua look like (I implement for iOS):
 

local ads = require( "ads" ) local appID = "ca-app-pub-MYNUMBERS" if ( system.getInfo( "platformName" ) == "Android" ) then     appID = "myAndroidAdProviderAppID" end local adProvider = "admob" function adListener( event ) -- end ads.init( adProvider, appID, adListener )

On my restart script (when user lost) code is:
 

function showAd()--I CALL THIS FUNCTION ON SCENE:SHOW(EVENT) if ( ads.isLoaded("interstitial") ) then     ads.show("interstitial") end end

Am I missed something?

Thanks

Are you adding:

local ads = require( "ads" )

to your restart.lua?

Rob

I’m succeed. Thank you very much Rob. And I added this line code ads.load( “interstitial”) on main.lua.