AdMob plugin - not being found

Hi, I just purchased the $200  1 year subscription for the admob plugin, but when I try to run on the device I get the error shown in the attached

I dropped in this code from the docs (the only difference being I plugged in my ad unit id and app id in the placeholders)

local admob = require( “plugin.admob” )

– AdMob listener function

local function adListener( event )

    if ( event.phase == “init” ) then  – Successful initialization

        – Load an AdMob interstitial ad

        admob.load( “interstitial”, { adUnitId=“YOUR_ADMOB_AD_UNIT_ID” } )

    end

end

– Initialize the AdMob plugin

admob.init( adListener, { appId=“YOUR_ADMOB_APP_ID” } )

if ( admob.isLoaded( “interstitial” ) ) then

    admob.show( “interstitial” )

end

and I have this in the build.settings:

   plugins =
      {
           [“plugin.admob”] =
             {
                  publisherId = “com.coronalabs”
             },  
       }

I must be doing something wrong? or does it take a while for the plugin to be activated? It’s showing as active in my list of plugins in the Corona Portal.

The error is attached as a screenshot to this post, but this is the gist of what it says:

error: could not load provider (admob) due to the following reason: … module ‘CoronaProvider.ads.admob’ not found:resource does not exist in archive… etc etc

I’m running  Corona Simulator 2017.3128

Thanks

I tried upgrading to the latest build but same problem.

I’m building on a PC for Android… Please help :slight_smile:

I did lots of searches and saw mention of putting supportedPlatforms in the build.settings. Still no luck.  Same error.

This is my full build.settings:

settings =
{
   plugins =
      {
           [“plugin.admob”] =
             {
                  publisherId = “com.coronalabs”,
                  supportedPlatforms = { android = true, iphone= false }
             },  

       
     },

    orientation =
    {
        default =“portrait”,-- Initial launch orientation
        supported =
        {
             “landscapeLeft”, “landscapeRight” – Table of allowed options for auto-orientation
        },
    },    

}
 

thanks

Try this sample code:

https://github.com/coronalabs/plugins-sample-admob

I tried upgrading to the latest build but same problem.

I’m building on a PC for Android… Please help :slight_smile:

I did lots of searches and saw mention of putting supportedPlatforms in the build.settings. Still no luck.  Same error.

This is my full build.settings:

settings =
{
   plugins =
      {
           [“plugin.admob”] =
             {
                  publisherId = “com.coronalabs”,
                  supportedPlatforms = { android = true, iphone= false }
             },  

       
     },

    orientation =
    {
        default =“portrait”,-- Initial launch orientation
        supported =
        {
             “landscapeLeft”, “landscapeRight” – Table of allowed options for auto-orientation
        },
    },    

}
 

thanks

Try this sample code:

https://github.com/coronalabs/plugins-sample-admob