Problem with ads and Admob, please help

Hi again everyone

My game is finally finished after nearly 2 years working 7 days a week on it.

Right now I’m only targeting Android because I don’t have an Apple computer.

I just need to monetize it, so I’ve gone with the first world being free with ads using admob because I’m new to this and want it to be as simple as possible.

I can’t get the ads to work at all.

I’m using Corona SDK daily build 2015.2688

My Build Settings…

settings = { orientation = { default = "landscapeRight", supported = { "landscapeRight" }, }, android = { versionCode = "10", googlePlayGamesAppId = "76XXXXXXXXXX", isGame = true, usesPermissions = { "android.permission.INTERNET", "android.permission.ACCESS\_NETWORK\_STATE", "android.permission.WRITE\_EXTERNAL\_STORAGE", "android.permission.READ\_EXTERNAL\_STORAGE" }, CFBundleIconFile = "Icon.png", CFBundleIconFiles = { "Icon-xxhdpi.png", "Icon-xhdpi.png", "Icon-hdpi.png", "Icon-mdpi.png", "Icon-ldpi.png" }, usesFeatures = { { name = "android.hardware.camera", required = false }, { name = "android.hardware.location", required = false }, { name = "android.hardware.location.gps", required = false } }, plugins = { ["CoronaProvider.native.popup.social"] = { publisherId = "com.coronalabs" }, ["CoronaProvider.gameNetwork.google"] = { publisherId = "com.coronalabs", supportedPlatforms = { android=true }, }, ["plugin.google.play.services"] = { publisherId = "com.coronalabs" }, }, } }

The ad code…

local ads = require( "ads" ) local MyappID = "ca-app-pub-XXXXXXXXXXXXXXXX/XXXXXXXXXX" -- I'm using the ID I set up in admob local adProvider = "admob" local function adListener( event ) local msg = event.response print( "Message from the ads library: ", msg ) if ( event.isError ) then print( "Error, no ad received", msg ) else ads.show( "interstitial", { appId=MyappID, testMode = true } ) end end ads.init( adProvider, MyappID, adListener ) ads:setCurrentProvider("admob")

This is the error log on my actual device…

ERROR:Could not load provider(admob) due to the following reason:/Users/jenkins/slaveroot/workspace/Templates/label/android/platform/resources/init.lua;835:module’CoronaProvider.ads.admob’ not found:resource(CoronaProvider.ads.admob.lu) does not exist in archive
no field
package.preload[‘CoronaProvider.ads.admob’]
no file ‘(null)/CoronaProvider/ads/admob.lua’
no file ‘(null)/CoronaProvider/ads/admob.lua’
no file ‘/data/app-lib/’

It looks like the ads plugin has not been installed when building the app, have I missed something in the build.settings? This feature does exist outside of Enterprise, right?

Hi @QuizMaster,

I think you’ve inadvertently dropped your “plugins” table inside the “android” table (in build.settings). Carefully, carefully check your table nesting and see if that’s the case.

I think you also dropped your “CFBundleIconFile” and “CFBundleIconFiles” table inside the “android” table, but that’s irrelevant since Android doesn’t accept app icons in the same ways as iOS… for Android, just include the proper icon files in your directory and they’ll be bundled into the .apk.

Hope this helps,

Brent

O.M.G. Well spotted Brent, this would also explain the problems I was having with Facebook before.

@QuizMaster, Still have your dead line of Christmas?

@SonicX278, yes mate, I’m frantic but it’s doable. I will let you know when it’s submitted, then when it’s approved hopefully.

Android? Apple? Windows phone 8?

–SonicX278

Android? Apple? Windows phone 8?

–SonicX278

Android first, then definitely Apple soon after…

Hi @QuizMaster,

I think you’ve inadvertently dropped your “plugins” table inside the “android” table (in build.settings). Carefully, carefully check your table nesting and see if that’s the case.

I think you also dropped your “CFBundleIconFile” and “CFBundleIconFiles” table inside the “android” table, but that’s irrelevant since Android doesn’t accept app icons in the same ways as iOS… for Android, just include the proper icon files in your directory and they’ll be bundled into the .apk.

Hope this helps,

Brent

O.M.G. Well spotted Brent, this would also explain the problems I was having with Facebook before.

@QuizMaster, Still have your dead line of Christmas?

@SonicX278, yes mate, I’m frantic but it’s doable. I will let you know when it’s submitted, then when it’s approved hopefully.

Android? Apple? Windows phone 8?

–SonicX278

Android? Apple? Windows phone 8?

–SonicX278

Android first, then definitely Apple soon after…