Admob problem !!!!!!

hey Guys,

I am using the admob plugin for the first time and therefore I need help from programmer who are more experienced than me.

This is my error code :

Copyright © 2009-2021 C o r o n a L a b s I n c .
Version: 3.0.0
Build: 2021.3648

Aug 25 21:51:29.907 WARNING: issue found in /Users/lorenzmartin/Desktop/Games/Game Engine Projects/Fruit Shooter/Fruit Shooter/build.settings:

Aug 25 21:51:29.908 WARNING: unrecognized key: settings.1.versionCode (string)

Aug 25 21:51:29.908 Copyright © 2009-2021 C o r o n a L a b s I n c .
Version: 3.0.0
Build: 2021.3648

Aug 25 21:51:29.930 Loading project from: ~/Desktop/Games/Game Engine Projects/Fruit Shooter/Fruit Shooter

Aug 25 21:51:29.930 Project sandbox folder: ~/Library/Application Support/Corona Simulator/Fruit Shooter-C32A65C7B2DD2D0325298268B354EFD0

Aug 25 21:51:29.980 Platform: iPhone / x86_64 / 11.2.3 / Intel® UHD Graphics 617 / 2.1 INTEL-16.1.12 / 2021.3648 / de-DE | DE | en_DE | en

Aug 25 21:51:38.474 admob.init() WARNING: The AdMob plugin is only supported on Android & iOS devices. Please build for device

Aug 25 21:51:38.475

Aug 25 21:51:38.484 admob.isLoaded() WARNING: The AdMob plugin is only supported on Android & iOS devices. Please build for device

Aug 25 21:51:38.484

This is my build.settings code:

settings =
{
orientation =
{
default =“portrait”,
supported = {“portrait”},
},

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

      },
  },

android =

  {
       applicationChildElements =
    {
        [[
            <meta-data  
                                            android:name="com.google.android.gms.ads.APPLICATION_ID"  

android:value="********************"/>
]],
},
},

      {
    versionCode = "11",
       },
      {
      midSdkVersion = "16",
      },

}

This is my main.lua code:
local admob = require( “plugin.admob” )

local appID = “***********************”

local interstitialUnitID = “****************************”

– AdMob listener function
local function adListener( event )

if ( event.phase == "init" ) then  -- Successful initialization
    -- Load an AdMob interstitial ad
    admob.load( "interstitial", { adUnitId="****************************" } )
end

end

– Initialize the AdMob plugin
admob.init( adListener, { appId="********************" } )

– Sometime later, show the interstitial ad
if ( admob.isLoaded( “interstitial” ) ) then
admob.show( “interstitial” )
end

Thank you for every help!!

  1. You didn’t explain what your problem was.
  2. The answer that you are looking for is likely explicitly stated in the logs that you copied. Give it a read.
1 Like

I have just started using admob plugin myself (although I am going to try today to go back to using the appodeal plugin instead), so not sure how much help I can be… but,

there are no ‘error’ messages in the info you provided. Just ‘warning’ messages. One of the warnings is that the “plugin does not work on the simulator - you have to build for device”.

So load your app to device and test that way. You won’t see any ‘ad output’ when running on the simulator.

Best of luck.

1 Like

the problem was that if I test my game on the device I can’t see any ads on my testing device.
actually the app isn’t opening. It crashes while opening.

My question was whether the problem is located in the code or there are other reasons.

I would appreciate an answer :slight_smile:

What are the advantages of the Appodeal plugin and is it easier to handle for beginners.
Can I use my Admob account with Appodeal too?

I tested the game on device but it crashes.

Do you think my main.lua code is right if not feel free to correct.

thanks for help

For starters, ensure that you are always setting testMode to true when developing and testing: https://docs.coronalabs.com/plugin/admob/init.html

With testMode enabled and when built for iOS/Android, you should begin to see ads. Once your app goes live, it may take a while before AdMob is ready to send you real ads.

1 Like

Also, if you want to debug on Android, read up on adb.
For iOS, if I recall correctly, the XCode console will display errors.

1 Like

You are trying to show the ad before it is loaded. Put an event.phase == “loaded” in the listener and call admob.show from there

1 Like

Can you write your example because I think I already have “isLoaded”

Thanks

Have anyone a solution why is my game crashing on the testing devise although there aren’t error messages?

Thanks

I think someone may have already mentioned; to make sure you have it flagged for test mode.

Did you add the ‘testMode’ flag in the init call

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

as to why I am re-trying appodeal, is simply because I had appodeal working maybe a year or more ago, but all my apps were removed recently as apple and google said they all ‘need updating’. So when I rebuilt my app to resubmit to the app stores, the appodeal plugin as I had it setup now failed. And after several days of trying to get it to work - tried just using the admob plugin.
But, when I have time (which I never do) I will try to get appodeal somehow to work… just because I ‘think’ it might produce better revenues … but I do not that from any personal experience.

Thanks for replying and yes I had added the testMode to my code.

Do you know what I have to add in the application ID in this call

 applicationChildElements =
    {
        [[
            <meta-data  
            android:name="com.google.android.gms.ads.APPLICATION_ID" 
            android:value="********************"/>

Thank you

sorry, I do not know what goes in those fields… that block of code does not look familiar to me