FAQ

Raymond Xie edited this page Jun 21, 2015 · 9 revisions

FAQ

Build fail when use cordova-plugin-admobpro in PhoneGap Build/Intel SDK ...

Only cordova CLI v5.x and newer support loading cordova-pluign-admobpro from npm.

Some tools or build services (PhoneGap Build, Intel XDK, Microsoft VS2005, etc.) are still using old version of cordova CLI and did not support it welll yet. A bug report is created to PhoneGap build service, see: https://github.com/phonegap/build/issues/439

Currently, using the old plugin id com.google.cordova.admob is a workaround.

Why Cordova CLI fail install the plugin with 404 Not found?

You are using a old version of Cordova CLI.

Cordova team announced npm repo is supported since cordova CLI v5.0

Only Cordova CLI v5.x and later support loading plugin from npm. Please upgrade your cordova CLI:

[sudo] npm install -g cordova

Build error with message "Multiple dex files define Lcom/google/..."

Caused by duplicated google-play-services.jar.

This plugin properly referenced to the google-play-services.jar in your android sdk with tag framework , which is recommended by Google team.

While some other plugins contains the jar, or depends on a plugin named com.google.playservices which is already deprecated.

Please list all plugins and check which plugin use it improperly, then report a bug to that plugin.

Build error with message "Not found com.google.android.gms:play-services-ads:+"

Google play services library or repository is not installed in your android SDK.

Type android sdk & to launch your Android SDK manager, check and confirm the items are installed.

See: android sdk frameworks

IDFA

Q: As Apple has special requirements for apps that use IDFA, it would be great if the docs could mention that and what you need to do about it.

screenshot

Can Ad really create income ?

Q: Do people really make money off the Ad's ? I hear all these stories where people are making tons of money but I am a bit discouraged.

A: Yes, surely you can make money with Ad. Some stat data about money:

RPM: (Revenue per 1000 impressions) CPC: (Cost Per Click) CTR (Click Rate)
Interstitial Ad: $1.5 Interstitial Ad: $0.1 1~3%
Banner Ad: $0.5 Banner Ad: $0.05

Your revenue definitely depends on the popularity of your apps. The more downloads, the more income you get.

For example: Flappy bird got over 100 million downloads, try calculating, how much income the author gets?

So, most important thing is writing a really good app or game that people like it, and promote (in forums, twitter, Facebook, youtube, or even use Ad) to get more downloads.

resources were not found ?

Q: I see error in LogCat "E/GooglePlayServicesUtil(13237): The Google Play services resources were not found."

A: It can be safely ignored, you will still get Ad.

See:


Failed to load ad ?

Q: Why I see black/blank Ad, with log "W/Ads (13237): Failed to load ad: 3"?

A: Error code 3 means "No fill", it happens when server cannot find suitable Ad resources in the inventory for your Ad request.

Advice: Check your Ad Unit Id.

  1. Though the argument key is "publisherId" for historical reason, the real purpose is Ad Unit Id, so do not use "pub-xxx", use "pub-xxx/xxx".

  2. Banner and interstitial Ad require different Ad unit Id, which is set in AdMob web console (http://www.admob.com/). If use banner Id for interstitial, it won't work.

  3. Some developers use video-only Ad for interstitial, the video inventory is not rich enough according to AdMob support team, and sometimes will not find suitable video Ad for you. You should void using video-only if hope to achieve a high fillrate.

Add Test Device ?

  • What shall I do with log "Use AdRequest.Builder.addTestDevice("xxxxxxxxxxxxxxx") to get test ads on this device"?

Answer:

  • If you are using cordova-plugin-admob, copy the code from log, and add to the java or obj-C code.

  • If you are using AdMob Plugin Pro (cordova-admob-pro), you can just ignore it, as the plugin code already get it done.

Could not parse mediation config?

Q: I see no Ads, with log "W/Ads(5038): Could not parse mediation config"

A: Check your Ad Unit Id. If a valid Ad unit Id is not given, it will cause such a error.

Sometimes in testing mode, the Ad server may also trigger such a error message. See AdMob official support

Insecure Content

Q: I see log "W/Ads ( 1799): JS: The page displayed insecure content!"

A: It's a warning message when the AdMob SDK switching request over HTTP and HTTPS protocol. See answer from AdMob support team:

Both BANNER and SMART_BANNER should work. The "insecure content" could be related to some experiments we're running with making the ad request in https. It's possible that certain creatives are loading assets over http. That should be just a warning though and not cause a no fill. Can you try SMART_BANNER again and confirm?

See AdMob official support forum.

How to Avoid Crash under Android 4.1.x

We must turn the acceleration off in order to make it work under JellyBean 4.1.X

In the AndroidMaifest.xml, change

< ... android:hardwareAccelerated="true" ...>

To

<... android:hardwareAccelerated="false" ...>

If the developer simply deletes that, the plugin will crash the program under JellyBean

Can I put Ad into HTML DIV ?

Q: Hi there, Is there an option to set the required add inside a div? I dont want the to be visible unless the user scrolled to the div.

A: NO. Ad banner is a native view, not a DOM element, so it cannot be inserted into a DIV. Unless using native Ad, which is still under Google beta for very few invited ones. We will add the feature once Google release native Ad.

Where to seek more support ?

  • AdMob official support forum

If your questions are related with logs with prefix "W/Ads", it's printed by the AdMob SDK, and related with Ad service, please ask in AdMob official support forum

  • Ask in StackOverflow.com

It's a good knowledge base, detailed explanation and source code examples.

  • Google with keyword "cordova admob"