Ads sample project not showing ads

Yay, moments later I noticed a major issue.

I had my phone in ‘Airplane Mode’ + Forced WiFi ON This wasn’t good enough.

I had to turn off Airplane mode. I then changed to showing ‘interstial ads’ and Viola, it worked!

I still can’t show banner ads, but this is a step forward.

Here is the project I used: https://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2020/05/inMobiHelp.zip

You can edit main.lua and add your own IDs to test it and see if it works.

After that I leave it up to you to decide what to do.

Ok I haven’t used ur code yet, but I added that loop in the adlistener function, and heres the log

V/Corona (13851): > Class.forName: network.LuaLoader
V/Corona (13851): < Class.forName: network.LuaLoader
V/Corona (13851): Loading via reflection: network.LuaLoader
I/Corona (13851): Platform: GT-I9500 / ARM Neon / 5.0.1 / PowerVR SGX 544MP / OpenGL ES 2.0 build 1.10@2359475 / 2018.3326 / עברית | IL | iw_IL | iw
V/Corona (13851): > Class.forName: _Corona_Build_Number.LuaLoader
V/Corona (13851): > Class.forName: shared.google.play.services.base.LuaLoader
V/Corona (13851): < Class.forName: shared.google.play.services.base.LuaLoader
V/Corona (13851): Loading via reflection: shared.google.play.services.base.LuaLoader
V/Corona (13851): > Class.forName: _CoronaSetup.LuaLoader
V/Corona (13851): > Class.forName: CoronaProvider.licensing.google.LuaLoader
V/Corona (13851): < Class.forName: CoronaProvider.licensing.google.LuaLoader
V/Corona (13851): Loading via reflection: CoronaProvider.licensing.google.LuaLoader
V/Corona (13851): > Class.forName: plugin.inMobi.LuaLoader
V/Corona (13851): < Class.forName: plugin.inMobi.LuaLoader
V/Corona (13851): Loading via reflection: plugin.inMobi.LuaLoader
I/Corona (13851): plugin.inMobi: 1.1.9 (SDK: 7.1.1)
I/Corona (13851): phase init
I/Corona (13851): provider inMobi
I/Corona (13851): name adsRequest
I/Corona (13851): isError false
I/Corona (13851): InMobi event: initialization successful
I/Corona (13851): placementId 157946*******
I/Corona (13851): type banner
I/Corona (13851): name adsRequest
I/Corona (13851): phase failed
I/Corona (13851): provider inMobi
I/Corona (13851): isError true
I/Corona (13851): response REQUEST_INVALID - Please check the site status on InMobi dashboard or reach out to PartnerManager
I/Corona (13851): InMobi event: banner ad failed to load

So im gonna check afew more things, can you realize whats the problem source now ?
my simulator version says 2018.3326

Ur app shows the same error :

I/Corona (20915): plugin.inMobi: 1.1.9 (SDK: 7.1.1)
I/Corona (20915): inMobi Listener Event @ function: 0xae2ae0d0
I/Corona (20915): isError: false; phase == “init”; response == “nil”
I/Corona (20915): Init phase completed!
I/Corona (20915): inMobi Listener Event @ function: 0xae2ae0d0
I/Corona (20915): isError: true; phase == “failed”; response == “REQUEST_INVALID - Please check the site status on InMobi dashboard or reach out to PartnerManager”
I/Corona (20915): inMobi is getting errors.
I/Corona (20915): placementId 1576824*******
I/Corona (20915): type interstitial
I/Corona (20915): name adsRequest
I/Corona (20915): phase failed
I/Corona (20915): provider inMobi
I/Corona (20915): isError true
I/Corona (20915): response REQUEST_INVALID - Please check the site status on InMobi dashboard or reach out to PartnerManager

this is the ad on inmobi page, not much to see here

That simulator version is reallly old. I strong suggest updating.

However, before you do, be sure you still have the OLD installer around.

I don’t want you to get into a situation where you relied on some feature of that old version of Corona that isn’t working the same. i.e. If you have the old installer, you have a way back to the version you’re using now. I personally kept a cache of all installers for Windows and Mac as they got updated (going back to 2012). While I don’t have every release, I have most.

If you don’t have the installer and you find you absolutely need to roll back, I have 2018.3297 for Windows/OSX as well as 2018.3363 for Windows/OSX.

Still using such an old version is really not a good idea.

I will update, I highly doubt it will solve the problem, searching for this error I found that inmobi does not respond and the users ended up switching to other platform, I will keep you update

meanwhile if you can suggest a free services for ads that will be good, I tried appnext but their require to publish your app before starting to monetize

download the latest 2020, not working still
also I downloaded it from corona labs site, dunno whats with the open source and name change when public build is still the same
should I use solar 2d?

Answering both posts.

  1. I don’t think it will solve your problem either, but using a (very) old version is generally not a good idea, because:
  • it can have bugs that are not in the recent version(s)
  • it may be using old libraries which may cause you issues when you go to release the game
  • it isn’t the same as the version most people have. You want to reduce the number of differences between your setup and others’ setups when cross debugging. More factors equal more things to track down and consider.
  1. Suggestions for Ad sources. I’m probably not the best person for this kind of advice, but:
  • My first suggestion is not to monetize at all. i.e. Nobody likes ads and most games won’t make much money with them. That said, people rarely listen to my advice on this…
  • My second suggestion… would be any of these in my order of preference/experience: Vungle5, Applovin, Appodeal, Admob. Note: Admob would be at the top, but I think the plugin for it is still paid, so if you don’t have a license you may be out of luck.
  1. Huh? ‘Latest’ is not a version number… - You said you downloaded the latest 2020, but that isn’t enough info. When asking for help (and continuing a thread) it is always best to say exactly what version you have. For example, I am running Solar2D 2020.3595 as downloaded via the page linked at the top of this page ‘Latest Build’. Please remember to be precise and detailed when describing problems and your setup, otherwise folks have to guess what you mean.

  2. Same error? - Are you sure you’re getting the same error after updating? i.e. I am getting a NO FILL error for banners. You seem to be getting a ‘REQUEST_INVALID’ for all ad types? Is that still true?

  3. Did you add your test device ID to your inMobi devices test list (under settings)?

You can get this id, by:
A. Running logcat like this: adb logcat
i.e. Do not filter for just Corona messages.

B. Init inMobi in debug mode (you are already doing this).

C. Look at the log and find messages with this string --> [inMobi]
One of these will have a ‘device ID’. Grab it and add that ID to your account.

Extra Notes:

  • I will try out my Vungle and Admob code over the weekend and see if either is functional and in the case of Admob if it works free or not. I’ll post back when I know more.

Ok thanks for your help.
what I ment is that I download the latest ‘daily build’ as seen on corona developer center download page, my 2018 build was the pubic build (should be most stable really.).
Anyway, I downloaded the latest build from GitHub via the link on top of this page, the build which has been released 3 days ago 2020.3595 .

I added my device to Inmobi tests devices and rebuild the app with the new simulator version.
same error

I/Corona (21217): plugin.inMobi: 1.1.9 (SDK: 7.1.1)
I/Corona (21217): phase init
I/Corona (21217): provider inMobi
I/Corona (21217): name adsRequest
I/Corona (21217): isError false
I/Corona (21217): InMobi event: initialization successful
I/Corona (21217): placementId 15794639xxxxx
I/Corona (21217): type banner
I/Corona (21217): name adsRequest
I/Corona (21217): phase failed
I/Corona (21217): provider inMobi
I/Corona (21217): isError true
I/Corona (21217): response REQUEST_INVALID - Please check the site status on InMobi dashboard or reach out to PartnerManager

its strange that it works for you but not for me, I don’t think it is something with corona , its inmobi, still it works for you so how is it possible?

Compare your settings to mine (images match numbers in order):

  1. An app w/o App URL (i.e. unpublished app w/ no store listing yet)

  2. Two placements: Banner & Interstitial

  3. Both placements have Diagnostics->Test Mode set to ‘Global On’ (default for unpublished)

  4. Interstitial (which works) has the settings shown.

  5. My phone ID is registered as a test device.





OK. I tried to build test apps for: adMob, Applovin, and Vungle.

All failed. So, for now I don’t have any more help I can offer.

What do you mean?? none of this ad services work?
what the heck is going on? what I am suppose to do??? you telling me you cant use ads on corona apps now?

I apricate your help, anyone on this forums using ads? someone has to know something !

I’m probably missing something here. I haven’t yet had time to:

  • Go back and read all the posts since the transition to the new forums and new builds.
  • Get set up for building locally.
  • Talk to my colleagues.

If this isn’t working now (not yet confirmed), I’m sure it is a temporary issue. I’m sorry for the frustration this is causing you, but I’m sure we’ll get this worked out given enough time.

@tal_nahum - GOOD NEWS…

Using Corona SDK 2018.3326 I successfully built and showed ads for:

  • AppLovin - Interstitial
  • Vungle 4 - Interstitial
  • Vungle 4 - Incentivized
  • Vungle 5 - Interstitial
  • inMobi – Interstitial

Current plugins tests and notes: https://github.com/roaminggamer/RG_FreeStuff/tree/master/AskEd/2020/05/plugins_help/ads

Kit of mini-samples: https://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2020/05/plugins_help.zip

Note: I have been so accustomed to using the latest version of Corona/Solar2D that it never really occurred to me that (in this time of transition) various versions might have issues for certain tasks.

So… I went back and did a full reset on my thinking. I created an initial set of plugins tests, focusing on ads only for now. See link above.

I will continue to add to this over time, but I’ll post about this in a separate thread.

For now, I hope this gets you unstuck.

1 Like

I’ve just been following this from the sidelines as I haven’t had anything worthwhile to contribute, but damn, that’s some dedicated support @roaminggamer.

@XeduR I just hate leaving things ‘not working’. :slight_smile:

@tal_nahum - When you go test this, I strongly suggest you use the mini examples I provided and add your IDs to main.lua/build.settings as appropriate. This way the test is separated from your game and you can focus on just the ads.

dam right he is, you are amazing thanks for your help, I would’ve been cluless without you
yet some tips, I mentioned that 2018.3326 is the public build and most stable, also the first suggestion to switch accountID with bannerPlacementID was out of place, and I knew it will not work, but you got things right in your mind after that…

I was will dig into what you posted and replay back, I really hope it will help, but I think that with inMobi its just the plugins fault

I tried vungle and used your sample code … the interstitial add showed once and then the rest of the times it said that there are no available ads to show right now, the banner ad didn’t show, said id was wrong, maybe because I was using SDK 5.1 and the banner required SDK 6.5 + , anyway I don’t know if the lack of ads are result of test mode, because if this is how it behaves live than it is worthless…
many of the ad services requires publishing the app first, so I dunno maybe I will have to do it, but then I will need to update my code and reupload to google play, u have experience with this? also you managed to test some other ad services by this time?, its really shame how lame those companies performe with their product… I didn’t know ads would be such a pain

I had a similar experience when I first setup Vungle (before the corona -> solar transition) It displayed 1 test ad, then I could never get it show another. I released it anyway because I was only using it on Amazon. Apparently it worked because it showed a few impressions. But once appodeal started working for amazon, I switched to that.

and how is appodeal is working for you? showing enough ads? setup was good ?

I just test admob with sample project, works like magic ! finally :sob:
a product by google , miles better then those trash services. big disadvantage is the payout threshold, really high

EDIT: I managed to show banner ad, and interstitial ad only once, then I get warning that ad could not load, im checking this now…

ok so im using admob, and the ads are showing as intended using sample project and ur project

yet I am having trouble on my own project…
I am using scenes architecture its very similar to the getting started app

main.lua -> menu.lua -> game.lua

in main I initialize admob, like this:

Summary
 local composer = require( "composer" )

-- Hide status bar
display.setStatusBar( display.HiddenStatusBar )

-- Seed the random number generator
math.randomseed( os.time() )
 admob = require( "plugin.admob" )

 -- Preset the AdMob app ID (replace this with your own for testing/release)

 -- This ID must be generated within the AdMob dashboard: https://apps.admob.com/

 local appID = "ca-app-pub-5779536996924****"



 -- Preset AdMob unit IDs (replace these with your own)

 -- These unit IDs must be generated within the AdMob dashboard: https://apps.admob.com/

 local bannerUnitID = "ca-app-pub-577953699692***"

 local  interstitialUnitID = "ca-app-pub-5779536996****"

 --ad Listener function
 local function adListener( event )
   if ( event.phase == "init" ) then  -- Successful initialization
           -- Load an AdMob banner ad and interstitial ad
		   print("init")
		admob.load( "interstitial", { adUnitId = interstitialUnitID } )
        admob.load( "banner", { adUnitId = bannerUnitID } )
           -- An ad loaded successfully
     	elseif ( event.phase == "loaded" ) then
		if (event.type == "banner") then
			admob.load( "banner", { adUnitId = bannerUnitID } )
			print("banner")
		 elseif (event.type == "interstitial") then
			admob.load( "interstitial", { adUnitId = interstitialUnitID } )
			print("interstitial")
           end
       end
   end


  admob.init( adListener, { appId=appID, testMode=true } )

-- Go to the menu screen
composer.gotoScene( "menu" )

that’s it, I tried using admob.show() inside scene:show function but I will get errors like cannot call init more then once… so right now , without any other code related to ads in my project, I get this :

I/Corona (18635): plugin.admob: 1.2.6 (SDK: 12451000)
I/Corona (18635): init
I/Corona (18635): banner
I/Corona (18635): interstitial
I/Corona (18635): banner
I/Corona (18635): interstitial
I/Corona (18635): banner
I/Corona (18635): interstitial
I/Corona (18635): banner
I/Corona (18635): show
I/Corona (18635): banner


also :

I/Corona (18635): plugin.admob: Test mode active for device ‘E012F5C59D8EF566E1CFCFCABD8B1A49’
I/Corona (18635): interstitial
I/Corona (18635): plugin.admob: Test mode active for device ‘E012F5C59D8EF566E1CFCFCABD8B1A49’
I/Corona (18635): banner
I/Corona (18635): plugin.admob: Test mode active for device ‘E012F5C59D8EF566E1CFCFCABD8B1A49’
I/Corona (18635): banner
I/Corona (18635): plugin.admob: Test mode active for device ‘E012F5C59D8EF566E1CFCFCABD8B1A49’
I/Corona (18635): interstitial

I have a gameloop ofcourse, but im not calling admob anywhere else
I tried doing it without this part:

elseif ( event.phase == "loaded" ) then
		if (event.type == "banner") then
			admob.load( "banner", { adUnitId = bannerUnitID } )
			print("banner")
		 elseif (event.type == "interstitial") then
			admob.load( "interstitial", { adUnitId = interstitialUnitID } )
			print("interstitial") 

it still gives me other errors like:

I/Corona (13714): ERROR: admob.isLoaded(adType [, options]), admob.init() must be called before calling other API functions

and

I/Corona (13714): WARNING: admob.init(listener, options), init() should only be called once

I have tried also using ur “test” function but and call It inside game.lua, but the init wont recognize the adlistener because its inside another function

basically im confusing, I need a simple solution to make things work right, because the services works well… its all about the coding
by the way, when installing my app (using android “File Manager”) the app crashes and restart 3 times before starting (only at the first time) that didn’t happen before starting to deal with ads