AdMob plugin error.

Hello I have a problem I wanted to connect plugin AdMob to the application and with the help of instructions I did what I wanted and made a build and uploaded to the phone when I run the application it crashes and there is a window where it says application failure I realized if I write [“plugin.admob”] = {publisherId = “com.coronalabs”} in build.settings then and for that the application crashes.
please help me I’ve been struggling for 3 days :frowning:

Hello I have a problem I wanted to connect plugin AdMob to the application and with the help of instructions I did what I wanted and made a build and uploaded to the phone when I run the application it crashes and there is a window where it says application failure I realized if I write [“plugin.admob”] = {publisherId = “com.coronalabs”} in build.settings then and for that the application crashes.
please help me I’ve been struggling for 3 days :frowning:

Did you follow project setup instructions?

Yes, I did everything as instructed in the instructions.
The app still doesn’t work.

The plugin works, so there is an error in your code somewhere. You’re going to have to post more code than the single line in build.settings.

A common failure point is not putting your AdMob application ID in applicationChildElements.

Exactly add in build.settings file.

android = {
applicationChildElements =
{
[[
< meta-data android:name=“com.google.android.gms.ads.APPLICATION_ID”
android:value=“ca-app-pub-xxxxxxxxxxxxxxxx~xxxxxxxxxx”/ >
]],
},
},

Well, not exactly- they’ll need to replace all the x’s. :rofl:

I did everything and it doesn’t work :slightly_frowning_face:

If you copy/pasted your plugin call straight out of your build.settings file, then the problem is that you’re using smart quotes.

What names quotes?
plugins =

{

[ "plugin.admob" ] =

{

publisherId = "com.coronalabs"

},

-- See: http://docs.coronalabs.com/plugin/att

},

What I mean is that what you originally posted uses smart quotes. Some text editors will automatically change “straight quotes” (which look like two perfectly vertical little lines) into opening and closing quotes.

Here is what you wrote in your original post:
…I realized if I write [“plugin.admob”] = {publisherId = “com.coronalabs”} in build.settings…

If you look closely, you can see that your quotes are not vertical lines, but the more stylized opening and closing quotes. It’s easier to see if I put it in a different font:
…I realized if I write [“plugin.admob”] = {publisherId = “com.coronalabs”} in build.settings…

It should be: ["plugin.admob"] = {publisherId = "com.coronalabs"}

Using opening and closing quotes instead of straight quotes will crash your program. Therefore, if you copy and pasted [“plugin.admob”] = {publisherId = “com.coronalabs”} straight out of your build.settings file, that’s why your application crashes.

It still doesn’t work.
source code:
TestAD.zip (67.4 KB)

You need to read the docs and do everything they specify to make it work

I took a look at your build.settings file, and you don’t have your application ID in applicationChildElements.

Ok now I added in build.settings applicationChildElements with application ID I made a build but nothing works.

Nothing works is a different problem than app crashes on launch and speaks to problems in either your AdMob Dashboard setup or implementation of the code. There isn’t a problem with the AdMob plugin- lots of people use it every day.

My suggestion to you is to very carefully go through the setup and try to get a minimum-viable app working. Make sure to use lots of print statements in the listener so you can tell where your failure points are and also make sure to register your test device with AdMob otherwise you will get no fill.