I'm developing application on Android with phonegap 2.2. Also i already added admob to my app, but sometimes i'm get an error:
Received ad url: <url: "http://...."
Request scenario: Offline with no buffered ads
Network is unavailable. Aborting ad request.
But there is no problem with network, as i can load other resources from internet.
But sometimes it receive ads successfully - and with the same parameters can't receive later...
I configured whitelist at phonegap config:
<access origin="*" subdomains="true"/>,
and manifest for admob.
Any help is appreciated!
If it works sometimes and not others, this usually means that your network connection is unstable. i.e dropping in and out.
Made another edit/update.
I removed some items from the build path to improve the app. By doing so, I believe something went screwy with the android build path in eclipse. I removed the admob sdk from references, then readded it back by Add to Build Path. It started working again.
It also might be because I was calling back to the native code in master.js using addJavaScriptInterface and that may be causing some thread conflicts and perhaps AdMob SDK is losing it's network permission. It wouldn't be the only time I have had issues as a result of using the addJavaScriptInterface function. It is the reason why I have to target 16 because Nexus devices will no longer work properly.
Last update: After all those changes above... I was getting it off and on. It appears that there was some project corruption, even after cleaning the project a half dozen times. I ended up creating another app project from scratch and adding the admob sdk to the lib folder. This issue no longer occurs. So strange.. wish I had something more specific to share.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With