corona ads error on android

First of all I can’t see it. You posted your direct URL to the file in Dropbox, not the share link.

Secondly, its so much better if you use the console log window that Corona provides for you. It should be a window that opens behind the simulator and all the console log, warning and error messages go there. You can easily use your mouse to select all the text (that’s needed), CTRL-C to copy and then CTRL-V to paste it in here. This much easier than taking a screen shot, uploading it somewhere, getting the URL and pasting it here.  And it’s way more useful to people trying to help to have the text than an image.

Also, the popup error window may not have the entire error message or warnings that preceded it which was the real cause of the error.

Rob

here is the error

:

02:35:57 I Corona : /Users/jenkins/slaveroot/workspace/Templates/label/android/platform/resources/init.lua:853: module 'plugin.coronaAds' not found:resource (plugin.coronaAds.lu) does not exist in archive 02:35:57 I Corona : no field package.preload['plugin.coronaAds'] 02:35:57 I Corona : no file '(null)/plugin/coronaAds.lua' 02:35:57 I Corona : no file '(null)/plugin/coronaAds.lua' 02:35:57 I Corona : no file '/data/app/com.gmail.davitzuroshvili.pizza\_tycoon-1/lib/arm/libplugin/coronaAds.so' 02:35:57 I Corona : no file './plugin/coronaAds.so' 02:35:57 I Corona : no file '(null)/plugin/coronaAds.so' 02:35:57 I Corona : no file '/data/app/com.gmail.davitzuroshvili.pizza\_tycoon-1/lib/arm/libplugin.so' 02:35:57 I Corona : no file './plugin.so' 02:35:57 I Corona : no file '(null)/plugin.so' 02:35:57 I Corona : no file '/data/app/com.gmail.davitzuroshvili.pizza\_tycoon-1/lib/arm/libplugin.coronaAds.so' 02:35:57 I Corona : no file './plugin.coronaAds.so' 02:35:57 I Corona : no file '(null)/plugin.coronaAds.so' 02:35:57 I Corona : stack traceback: 02:35:57 I Corona : [C]: in function 'require' 02:35:57 I Corona : /Users/jenkins/slaveroot/workspace/Templates/label/android/platform/resources/init.lua:853: in function 'require' 02:35:57 I Corona : ?: in main chunk

You have an error in your build.settings file:

settings = { orientation= { default="portrait", su --\<------- This is an error. I think you want: supported = { "portrait", "portraitUpsideDown" }, } --\<------- You are missing a comma after the curly brace plugins = {

what about the error can you explain me that please

Because you have an error in your build.settings, none of your plugins are loading. When you try to access the plugin in your .Lua code you can’t find the plugin which is generating that error.

Rob

i get the same error with proper orientation table end without orientation table

Please post your current build.settings file.

Thanks

Rob

settings = { orientation= { default="portrait", supported = { "portrait", "portraitUpsideDown" } }, plugins = { ["plugin.coronaAds"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, android=true ,["iphone-sim"]=true} }, ["plugin.google.play.services"] = { publisherId = "com.coronalabs", supportedPlatforms = { android=true } }, ["shared.android.support.v4"] = { publisherId = "com.coronalabs", supportedPlatforms = { android=true } } }, -- If building for iOS, add these three entries to the "plist" table iphone = { plist = { NSAppTransportSecurity = { NSAllowsArbitraryLoads=true }, NSLocationAlwaysUsageDescription = { "" }, NSLocationWhenInUseUsageDescription = { "" }, }, }, }

You’re build.settings look correct. Can you post the code where you’re requiring the plugin in your main.lua?

-- -- Corona Ads -- local coronaAds = require( "plugin.coronaAds" ) -- Substitute your own placement IDs when generated local bannerPlacement = "top-banner-320x50" local interstitialPlacement = "interstitial-1" -- Corona Ads listener function local function adListener( event ) -- Successful initialization of Corona Ads if ( event.phase == "init" ) then -- Show an ad coronaAds.show( bannerPlacement, false ) --coronaAds.show( interstitialPlacement, true ) end end -- Initialize Corona Ads (substitute your own API key when generated) coronaAds.init( "5223c2c3-cf81-4c43-ae41-2d4ed16552bc", adListener ) local widget = require("widget") local pizzeria = display.newImage("background.png") pizzeria.x=160 pizzeria.y=230 pizzeria:scale(1,1) local pizzas=0 local chefs=0 local cookers=0 local robot=0 local autostove=0 local musicswitch = 1 local backgroundMusic = audio.loadStream("b.mp3") local backgroundMusicChannel = audio.play( backgroundMusic, { channel=1, loops=-1, fadein=5000 } ) local textmaker = 0 local robotcost=display.newText("cost-70",150,300,display.contentWidth\*0.7,display.contentHeight\*0.7,native.systemFont,16) robotcost:setFillColor(10,5,0) local chefcost=display.newText("cost-10",150,350,display.contentWidth\*0.7,display.contentHeight\*0.7,native.systemFont,16) chefcost:setFillColor(0,0,0) local cookercost=display.newText("cost-25",300,350,display.contentWidth\*0.7,display.contentHeight\*0.7,native.systemFont,16) cookercost:setFillColor(10,5,0) local autostovecost=display.newText("cost-250",220,440,display.contentWidth\*0.7,display.contentHeight\*0.7,native.systemFont,16) autostovecost:setFillColor(10,5,0) local pizzatext = display.newText("pizzas:", 100, 200, display.contentWidth\*0.6, display.contentHeight \* 0.7, native.systemFont, 16) pizzatext:setFillColor( 0, 0, 0) local pizzacount = display.newText(pizzas,165,200,display.contentWidth\*0.7,display.contentHeight\*0.7,native.systemFont,16) pizzacount:setFillColor(10,5,0) local chefstext = display.newText("chefs:",320,200,display.contentWidth\*0.7,display.contentHeight\*0.7,native.systemFont,16) chefstext:setFillColor(0,10,10) local chefscount = display.newText(chefs,363,200,display.contentWidth\*0.7,display.contentHeight\*0.7,native.systemFont,16) chefscount:setFillColor(10,5,0) local cooktext = display.newText("coookers:",320,230,display.contentWidth\*0.7,display.contentHeight\*0.7,native.systemFont,16) cooktext:setFillColor(10,5,0) local cookcount = display.newText(cookers,390,230,display.contentWidth\*0.7,display.contentHeight\*0.7,native.systemFont,16) cookcount:setFillColor(0,0,0) local robottext = display.newText("robot:",320,260,display.contentWidth\*0.7,display.contentHeight\*0.7,native.systemFont,16) robottext:setFillColor(0,10,10) local robotcount = display.newText(robot,363,260,display.contentWidth\*0.7,display.contentHeight\*0.7,native.systemFont,16) robotcount:setFillColor(10,5,0) local autostovetext = display.newText("autostove:",320,290,display.contentWidth\*0.7,display.contentHeight\*0.7,native.systemFont,16) autostovetext:setFillColor(0,0,0) local autostovecount = display.newText(autostove,395,290,display.contentWidth\*0.7,display.contentHeight\*0.7,native.systemFont,16) autostovecount:setFillColor(10,5,0) local objective = display.newText("Reach 1000000000 pizzas",400,100) local function makeChefPizza() pizzas=pizzas+chefs+cookers\*2+robot\*3+4\*autostove pizzacount.text=pizzas end local function pizzamaker( event ) if (pizzas\>=10000000000) then winscreen=display.newImage("youwin.jpeg") winscreen:translate(150,200) winscreen:scale(1.5,3) end if ( "ended" == event.phase ) then pizzas=pizzas+1 pizzacount.text=pizzas end end local function addchef( event ) if("ended" == event.phase) then if(pizzas\>=10) then chefs=chefs+1 chefscount.text=chefs pizzas=pizzas-10 pizzacount.text=pizzas end end end local function addcooker( event ) if("ended"== event.phase) then if(pizzas\>=25) then cookers=cookers+1 cookcount.text=cookers pizzas=pizzas-25 pizzacount.text=pizzas end end end local function addrobot( event ) if("ended"==event.phase) then if(pizzas\>=70) then robot=robot+1 robotcount.text=robot pizzas=pizzas-70 pizzacount.text=pizzas end end end local function addautostove( event ) if("ended"==event.phase) then if(pizzas\>=250) then autostove=autostove+1 autostovecount.text=autostove pizzas=pizzas-250 pizzacount.text=pizzas end end end local pizzamaker = widget.newButton { left = 200, top = 400, defaultFile="button.jpeg", overFile = "button.jpeg", label = "Make Pizza", height = 50, width= 100, onEvent =pizzamaker } local addchef = widget.newButton { left = 60, top = 200, defaultFile="pizzachef.png", overFile="pizzachef.png", height = 70, width = 70, onEvent = addchef } local addcooker = widget.newButton { left = 150, top = 200, defaultFile="pizzacooker.jpeg", overFile="pizzacooker.jpeg", height=70, width=70, onEvent=addcooker } local addrobot = widget.newButton { left = 100, top = 100, defaultFile="robot.png", overFile="robot.png", height=70, width=70, onEvent=addrobot } local addautostove = widget.newButton { left = 100, top = 300, defaultFile="autostove.jpg", overFile="autostove.jpg", height=70, width=100, onEvent=addautostove } timer.performWithDelay(1000, makeChefPizza, -1)

Can you humor me and comment out this line in build.settings:

supportedPlatforms = { iphone=true, android=true ,[“iphone-sim”]=true}

Thanks

Rob

i have deleted that line and it isnt crashing anymore thank you rob know everything is know depending on my fill rate right?

higher the fill rate more ads right?

The fill rate is how many ads show based on the number of requests.

If you request 10 ads, but only get 5, you have a 50% fill rate. If your fill rates is 100% and you requested 10 ads, you would get 10 ads.

Rob

so without that line i have deleted it will work just fine right?

Hopefully

thanks for your help rob 

Rob,

I moved from Java 6.45 to 8.1 and immediately started getting the Not Found message on my plugins for AppNext and AppLovin- regardless of app.  I commented out the supported platforms as you suggested above and the error went away.  Is this something you’ve found with a later release of Java - (I remember the years of “you must use Java 6”)  and anything to watch for by not having the supported platforms identified?    Windows 10 kept removing Java 6, no matter that I had the auto update turned off for both the SDK and JRE.

thanks

Dave

First the version of Java has nothing to do with this. We use Java’s tools to sign the apps and create keystores. Enterprise users for Android will depend more on Java since they are writing native code.e

The purpose of supportedPlatforms is to **limit** where the plugin loads. Without it, the system will try to load the plugin for every platform you build for. But you may only want to load a plugin for Android and not iOS. A great example of this is our “Social” plugin. Back in the day of iOS 6 and earlier, if you wanted to share to Facebook or Twitter you would build a panel and insert buttons in for each social network you wanted to support. Apple has superseded that with their new sharing system UIActivityViewController. This is the window that pops up when you tap the square icon with an arrow coming from the top.  We have a plugin for this called the activity plugin. However on Android, you want to still use the social plugin because it’s the current Android way of sharing.

Now you want to include “activity” for iOS and “social” for Android. But “social” is available for both. You could just include it, but it would add extra size to your app. So you can use supportedPlatforms to exclude social for iOS while keeping it for Android.

As a rule if we don’t support a platform, we include a “stub” plugin that has all of the API’s but they just output “This plugin is not available for this platform”. Without the stub, your program would error. 

Rob

Rob so after that my app starts it works for like a 2 seconds and it crashes what might be a reason?

What error are you getting?

Is this in the simulator or on a device?

What messages are in the console log?