appfeel / admob-google-cordova Goto Github PK
View Code? Open in Web Editor NEWAdMob ads Cordova/Phonegap/Intel XDK plugin for Android iPhone with latest SDK's
License: MIT License
AdMob ads Cordova/Phonegap/Intel XDK plugin for Android iPhone with latest SDK's
License: MIT License
Hi,
i used this Plugin for some month now and everything is awesome. But yesterday i tried my latest build and got some Compile Errors for iOS (Android is still fine):
The following build commands failed:
CompileC build/xxx.build/Release-iphoneos/xxx.build/Objects-normal/armv7/CDVAdMobAds.o xxx/Plugins/com.admob.google/CDVAdMobAds.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC build/xxx.build/Release-iphoneos/xxx.build/Objects-normal/armv7/CDVAdMobAdsAdListener.o xxx/Plugins/com.admob.google/CDVAdMobAdsAdListener.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)
I don't know if it's me or PGB or the Plugin but i can't compile my App anymore and changed nothing to the Plugin. I made a ticket on PGB too but got no response yet.
Hey, is this planned to be published to Phonegap Build?
If not: is there a reason for not doing it?
cheers
Does this plugin auto show Interstitials? As in every 2 minutes?
_I know this isn't supposed to be in the Issues section but I have no other way of contacting the developer._
Hi,
sry to bother you again. On Android the Banner doesn't show when i open the app. When i lock the Screen and switch back to the App the Banner is there.
This guy has the same problem but i'm on Phonegap Build with the Ionic Framework : http://stackoverflow.com/questions/21408178/admob-wont-show-the-banner-until-refresh-or-sign-in-to-google-plus
I tried:
admob.createBannerView({publisherId: admob_key});
admob.setBackgroundColor('#000000');
with no effect.
Hello
I have a Sencha Touch/Cordova project and I'm using this plugin. It works great on android, but there seems to be a problem with iOS interstitial ads.
I call the admob.requestInterstitialAd
providing it with the publisherId being the interstitial ad unit id, and the isTesting flag set to true.
When the admob.events.onAdLoaded
event is fired, I checked the type of the ad in case of interstitial, and it was interstitial, however when the admob.events.onAdClosed
event is fired, the ad type in the parameters is banner.
Any help with this?
Thank you :)
hi all
is there any update related to recent eu cookie policy? any script that blocks ads prior retrieving userìs approval?
thanks in advance
When user click on Admob, goes to "Chrome" and after this user turn back, the app crash and show this: "App has stopped".
Hello,,
The plugin is amazing. it does the job perfectly. however, i had an issue making it work with my app that works with Google Maps plugin for cordova. loading an ad was breaking the map so i worked it around by loading the ad first and then load the map with the admob.events.onAdLoaded event. however, once i load the map the ad is moving to the top. it's very unclear to me why this is happening and what could i do for it.
Any suggestions?
When I add the admob banner ad at the bottom using your plugin, I have to open the ad once to activate my app. When I touch the app without opening the ad, it's unresponsive. My config.xml and index.html are given below. Once I touch the ad banner, the app works fine.
index.html
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<title>Move N Block</title>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/phaser.js"></script>
<script type="text/javascript" src="js/load.js"></script>
<script type="text/javascript" src="js/menu.js"></script>
<script type="text/javascript" src="js/play.js"></script>
<script type="text/javascript" src="js/p1wins.js"></script>
<script type="text/javascript" src="js/p2wins.js"></script>
<script type="text/javascript" src="js/game.js"></script>
<script type="text/javascript">
document.addEventListener('deviceready', function() {
navigator.splashscreen.hide();
admob.setOptions({
publisherId: "ca-app-pub-AAAAAAAAAAAAAAAA/BBBBBBBBBB",
isTesting: true
});
admob.createBannerView();
});
</script>
</head>
<body>
<div id="gameDiv"> </div>
</body>
</html>
config.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- config.xml reference: https://build.phonegap.com/docs/config-xml -->
<widget xmlns = "http://www.w3.org/ns/widgets"
xmlns:gap = "http://phonegap.com/ns/1.0"
id = "com.akshaynagpal.xyz"
versionCode = "5"
version = "1.3.0">
<name> Block</name>
<description>
It's a 2 player game.
</description>
<author href="" email="">
Akshay Nagpal
</author>
<preference name="permissions" value="none"/>
<preference name="orientation" value="portrait" />
<preference name="target-device" value="universal" />
<preference name="fullscreen" value="true" />
<preference name="android-installLocation" value="auto" />
<preference name="android-minSdkVersion" value="14"/>
<preference name="SplashScreenDelay" value="3000" />
<!-- Plugins -->
<gap:plugin name="phonegap-admob" source="npm"/>
<!-- Define app icon for each platform. -->
<icon src="icon.png" />
<icon src="res/icon/android/36.png" gap:platform="android" gap:qualifier="ldpi" />
<icon src="res/icon/android/48.png" gap:platform="android" gap:qualifier="mdpi" />
<icon src="res/icon/android/72.png" gap:platform="android" gap:qualifier="hdpi" />
<icon src="res/icon/android/96.png" gap:platform="android" gap:qualifier="xhdpi" />
<icon src="res/icon/android/144.png" gap:platform="android" gap:qualifier="xxhdpi" />
<icon src="res/icon/android/192.png" gap:platform="android" gap:qualifier="xxxhdpi" />
<!-- Define app splash screen for each platform. -->
<gap:splash src="splash.png" />
<gap:splash src="res/screen/android/240_320.png" gap:platform="android" gap:qualifier="ldpi" />
<gap:splash src="res/screen/android/320_480.png" gap:platform="android" gap:qualifier="mdpi" />
<gap:splash src="res/screen/android/480_800.png" gap:platform="android" gap:qualifier="hdpi" />
<gap:splash src="res/screen/android/720_1280.png" gap:platform="android" gap:qualifier="xhdpi" />
<gap:splash src="res/screen/android/960_1600.png" gap:platform="android" gap:qualifier="xxhdpi" />
<gap:splash src="res/screen/android/1280_1920.png" gap:platform="android" gap:qualifier="xxxhdpi" />
<gap:plugin name="org.apache.cordova.splashscreen" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
</widget>
Please help.
Recently all my apps have been getting the same message when I try and compile them using PhoneGap Build:
Error - One of your plugins required the gradle android build tool to build - You can fix this here
Is there something else that I need to add to the config.xml to fix this issue?
Any advice here would be great.
Thanks,
Simon
I'm failing to build my app using <gap:plugin name="com.admob.google" source="plugins.cordova.io" version="2.0.14"/>
because I get plugin source unsupported: com.admob.google from plugins.cordova.io
error.
Why isn't this working??
Hello,
I have a problem when I try to compile cordova to test on my phone.
I find this error word:
FAILURE: Build failed with an exception
*What went wrong:
Execution failed for task':mergeDebugResources'.
C:\Users\KrST\Documents\Visual Studio 2015\Projects\BlankCordovaApp1\BlankCordovaApp1\platforms\android\build\intermediates\exploded-aar\com.google.android.gms\play-services-base\9.2.0\res\drawable-hdpi-v4\common_plus_signin_btn_icon_light_disabled.9.png: Error: File path too long on Windows, keep below 240 characters : C:\Users\KrST\Documents\Visual Studio 2015\Projects\BlankCordovaApp1\BlankCordovaApp1\platforms\android\build\intermediates\exploded-aar\com.google.android.gms\play-services-base\9.2.0\res\drawable-hdpi-v4\common_plus_signin_btn_icon_light_disabled.9.png
*try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Error code 1 for command: cmd with args: /s,/c,""C:\Users\KrST\documents\visual studio 2015\Projects\BlankCordovaApp1\BlankCordovaApp1\platforms\android\gradlew" cdvBuildDebug -b "C:\Users\KrST\documents\visual studio 2015\Projects\BlankCordovaApp1\BlankCordovaApp1\platforms\android\build.gradle" -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"
Can you help me?
cordially
when building in Xcode iOS 9.X and in Ionic CLI (iOS 9.X) I get below console errors:
is this ad mob plugin using the latest SDK?
Failed to receive ad with error: Request Error: Invalid ad request parameter(s). Check the Xcode console for details.
2016-02-25 20:37:07.072 [711:92268] Google:HTML You are currently using version 7.3.1 of the SDK. Please consider updating your SDK to the most recent SDK version to get the latest features and bug fixes. The latest SDK can be downloaded from http://goo.gl/iGzfsP. A full list of release notes is available at https://developers.google.com/admob/ios/rel-notes.
-canOpenURL: failed for URL: "kindle://home" - error: "This app is not allowed to query for scheme kindle"
[CDVAdMobAdsAdListener adView:didFailToReceiveAdWithError:]: Failed to receive ad with error: Request Error: Invalid ad request parameter(s). Check the Xcode console for details.
As I stir this error that comes out when I try to build ??
Error: more than one library with package name 'com.google.android.gms'
This plugin does not has support to Windows Phone 10. Do you have some solution for it?
Hello
Yesterday the phonegap build stopped working, i notified them and tried everything i can do but nothing helped. today i removed this plugin from my config.xml file and the build worked!
Just wanted to tell you about this problem, hope you fix it 'cause this plugin is good enough for me.
P.S. : the problem was with building the apk, the windows phone version was built just fine
Thanks for using the the content from my page.
I notice that you have no test folder, so some content in README.md may not be suitable to you. please update accordingly.
Hi,
Please replace the documentation of showAd method with showBannerAd and showInterstitialAd as these methods are the ones we can find while coding.
Thanks and regards
Christophe
I am showing an interstitial ad in my Cordova project. This works great, both on Android and iOS.
The 'onAdLoaded' event is called on both platforms when the ad is on screen.
However, when I close the Ad (hit the X-icon) the onAdClosed event is only called on Android, not on iOS.
Same for the 'resume' event: only called on Android, not on iOS.
document.addEventListener(admob.events.onAdClosed, function(e) {
alert('ad closed');
}, false);
document.addEventListener("resume", function() {
alert('resume');
}, false);
Both alerts do appear on Android, none of them appear on iOS.
How can I detect the user closed the interstitial ad on iOS?
(I am using Cordova 6.1.1 and AdMob plugin version 4.2.9)
When testing apps with admob, Google requires users to use
AdRequest.Builder.addTestDevice("deviceIDhere")
This request appears also in the LogCat output.
It is simple to achieve this while programming an app using Java, but what when using cordova + appfeel.
Is it possible? Would it be possible to add a feature to achieve this?
Hi,
i can't compile my android app anymore since i've added this plugin.
i've used this command to add the plugin:
cordova plugin add com.admob.google
in the console i see this error:
[javac] ***my-app-path***\platforms\android\src\com\appfeel\cordova\admob\AdMobAds.java:56: error: package com.appfeel.cordova.connectivity does
not exist
[javac] import com.appfeel.cordova.connectivity.Connectivity;
[javac] ^
[javac] ***my-app-path***\platforms\android\src\com\appfeel\cordova\admob\AdMobAds.java:57: error: package com.appfeel.cordova.connectivity.Conn
ectivity does not exist
[javac] import com.appfeel.cordova.connectivity.Connectivity.IConnectivityChange;
[javac] ^
[javac] ***my-app-path***\platforms\android\src\com\appfeel\cordova\admob\AdMobAds.java:65: error: cannot find symbol
[javac] public class AdMobAds extends CordovaPlugin implements IConnectivityChange {
[javac] ^
[javac] symbol: class IConnectivityChange
[javac] ***my-app-path***\platforms\android\src\com\appfeel\cordova\admob\AdMobAds.java:98: error: cannot find symbol
[javac] private Connectivity connectivity;
[javac] ^
[javac] symbol: class Connectivity
[javac] location: class AdMobAds
[javac] ***my-app-path***\platforms\android\src\com\appfeel\cordova\admob\AdMobAds.java:145: error: cannot find symbol
[javac] connectivity = Connectivity.GetInstance(cordova.getActivity(), this);
[javac] ^
[javac] symbol: variable Connectivity
[javac] location: class AdMobAds
[javac] ***my-app-path***\platforms\android\src\com\appfeel\cordova\admob\AdMobAds.java:810: error: method does not override or implement a meth
od from a supertype
Conficts with Google Play Services solutions .....
Exemple:
Google Analytics:
conflit with: https://github.com/danwilson/google-analytics-plugin
Hi,
I am using your sample code for phone gap build and even though I have isTesting: true set, I still see ads in my Android app (only using banner, no interstitial). Also, I don't see any impressions in the admob account (not sure if this is related), I tried using isTesting: false, but that made no difference. I am 100% sure I use the correct pub ID and I waited several days.
I use phone gap 3.3.0
I call these two methods in my html file
app.startBannerAds();
app.showBannerAds(); (note: when I do not uncomment the JSON error output below I get following alert: "adview is null, call createBannerView first", but ads still show up fine)
Please do let me know if you need more info.
This is my index.js code:
var app = {
// global vars
autoShowInterstitial: false,
progressDialog: document.getElementById("progressDialog"),
spinner: document.getElementById("spinner"),
weinre: {
enabled: false,
ip: '', // ex. http://192.168.1.13
port: '', // ex. 9090
targetApp: '' // ex. see weinre docs
},
// Application Constructor
initialize: function () {
if (( /(ipad|iphone|ipod|android)/i.test(navigator.userAgent) )) {
document.addEventListener('deviceready', this.onDeviceReady, false);
} else {
app.onDeviceReady();
}
},
// Must be called when deviceready is fired so AdMobAds plugin will be ready
initAds: function () {
var isAndroid = (/(android)/i.test(navigator.userAgent));
var adPublisherIds = {
ios : {
banner: 'ca-app-pub-xxx/xxx',
interstitial: 'ca-app-pub-xxx/xxx'
},
android : {
banner: 'ca-app-pub-xxx/xxx',
interstitial: 'ca-app-pub-xxx/xxx'
}
};
var admobid;
if (isAndroid) {
admobid = adPublisherIds.android;
} else {
admobid = adPublisherIds.ios;
}
admob.setOptions({
publisherId: admobid.banner,
interstitialAdId: admobid.interstitial,
bannerAtTop: true, // set to true, to put banner at top
overlap: false, // set to true, to allow banner overlap webview
offsetStatusBar: true, // set to true to avoid ios7 status bar overlap
isTesting: true, // receiving test ads (do not test with real ads as your account will be banned)
autoShowBanner: true, // auto show banners ad when loaded
autoShowInterstitial: false // auto show interstitials ad when loaded
});
},
// Bind Event Listeners
bindAdEvents: function () {
document.addEventListener("orientationchange", this.onOrientationChange, false);
document.addEventListener(admob.events.onAdLoaded, this.onAdLoaded, false);
document.addEventListener(admob.events.onAdFailedToLoad, this.onAdFailedToLoad, false);
document.addEventListener(admob.events.onAdOpened, function (e) {}, false);
document.addEventListener(admob.events.onAdClosed, function (e) {}, false);
document.addEventListener(admob.events.onAdLeftApplication, function (e) {}, false);
document.addEventListener(admob.events.onInAppPurchaseRequested, function (e) {}, false);
},
// -----------------------------------
// Events.
// The scope of 'this' is the event.
// -----------------------------------
onOrientationChange: function () {
app.onResize();
},
onDeviceReady: function () {
var weinre,
weinreUrl;
document.removeEventListener('deviceready', app.onDeviceReady, false);
if (admob) {
console.log('Binding ad events...');
app.bindAdEvents();
console.log('Initializing ads...');
app.initAds();
} else {
alert('AdMobAds plugin not ready');
}
},
onAdLoaded: function (e) {
app.showProgress(false);
if (e.adType === admob.AD_TYPE.INTERSTITIAL) {
if (app.autoShowInterstitial) {
admob.showInterstitialAd();
} else {
alert("Interstitial is available. Click on 'Show Interstitial' to show it.");
}
}
},
onAdFailedToLoad: function(e) {
app.showProgress(false);
alert("Could not load ad: " + JSON.stringify(e));
},
onResize: function () {
var msg = 'Web view size: ' + window.innerWidth + ' x ' + window.innerHeight;
document.getElementById('sizeinfo').innerHTML = msg;
},
// -----------------------------------
// App buttons functionality
// -----------------------------------
startBannerAds: function () {
app.showProgress(true);
admob.createBannerView(function (){}, function (e) {
alert(JSON.stringify(e));
});
},
removeBannerAds: function () {
app.showProgress(false);
admob.destroyBannerView();
},
showBannerAds: function () {
app.showProgress(false);
admob.showBannerAd(true, function (){}, function (e) {
// alert(JSON.stringify(e));
});
},
hideBannerAds: function () {
app.showProgress(false);
admob.showBannerAd(false);
},
requestInterstitial: function (autoshow) {
app.showProgress(true);
app.autoShowInterstitial = autoshow;
admob.requestInterstitialAd(function (){}, function (e) {
alert(JSON.stringify(e));
});
},
showInterstitial: function() {
app.showProgress(false);
admob.showInterstitialAd(function (){}, function (e) {
alert(JSON.stringify(e));
});
},
showProgress: function(show) {
if (show) {
addClass(app.spinner, "animated");
removeClass(app.progressDialog, "hidden");
} else {
addClass(app.progressDialog, "hidden");
removeClass(app.spinner, "animated");
}
}
};
function removeClass(elem, cls) {
var str;
do {
str = " " + elem.className + " ";
elem.className = str.replace(" " + cls + " ", " ").replace(/^\s+|\s+$/g, "");
} while (str.match(cls));
}
function addClass(elem, cls) {
elem.className += (" " + cls);
}
Hi,
Using Cordova 3.6.3-0.2.13 in iOS 8 the plugin not parameterize correctly the "overlap" property and the BannerView always has the value "true", or at least so it behaves.
Someone else has encountered the same problem?
Regards,
every time i m trying to use admob i get
work to work on that
and my code is angular.module('app', ['onsen', 'ui.bootstrap', 'ng-autocomplete','admobModule'])
.config(['admobSvcProvider', function (admobSvcProvider)
{
admobSvcProvider.setOptions
({
publisherId: 'ca-app-pub-5529525978454334/3896374806',
tappxIdAndroid: '/120940746/Pub-8303-Android-5260',
interstitialAdId: 'ca-app-pub-3940256099942544/1033173712',
tappxShare: 0.5,
bannerAtTop: true,
});
admobSvcProvider.setPrefix('myTag~');
}])
.run(['admobSvc', function (admobSvc) {
admobSvc.createBannerView();
//document.addEventListener("deviceready", onDeviceReady, false);
//$rootScope.$on(admobSvc.events.onAdOpened, function onAdOpened(evt, e) {
// console.log('adOpened: type of ad:' + e.adType);
//});
}])
I use phonegap builder and when i include
<gap:plugin name="cordova-admob" source="npm" version="4.1.6" />
<gap:plugin name="com.adobe.plugins.gaplugin" version="2.4.0" />
into config.xml build failed.
[dx] UNEXPECTED TOP-LEVEL EXCEPTION:
[dx] com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/analytics/internal/Command$1;
[dx] at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
[dx] at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
[dx] at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
[dx] at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
[dx] at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
[dx] at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:502)
[dx] at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
[dx] at com.android.dx.command.dexer.Main.run(Main.java:277)
[dx] at com.android.dx.command.dexer.Main.main(Main.java:245)
[dx] at com.android.dx.command.Main.main(Main.java:106)
[dx]
BUILD FAILED
/android-sdk/tools/ant/build.xml:888: The following error occurred while executing this line:
/android-sdk/tools/ant/build.xml:890: The following error occurred while executing this line:
/android-sdk/tools/ant/build.xml:902: The following error occurred while executing this line:
/android-sdk/tools/ant/build.xml:283: null returned: 2
Total time: 42 seconds
/project/cordova/node_modules/q/q.js:126
throw e;
^
Error code 1 for command: ant with args: debug,-f,/project/build.xml
My app displays listings usually around 5,000 ad requests a day, however on December 29 he stopped display ads alone, I did not send any updates. I did some test using the code below:
var temporizador;
document.addEventListener("deviceready", function() {
admob.setOptions({
publisherId: "ca-app-pub-xxxxxxxxxxxxxxxx/yyyyyyyyyy", // Required
interstitialAdId: "ca-app-pub-xxxxxxxxxxxxxxxx/yyyyyyyyyy", // Optional
autoShowInterstitial: true,
isTesting: false,
});
temporizador = setInterval(function() {
admob.requestInterstitialAd({}, function() {
alert('success');
}, function() {
alert('error');
});
}, 5000);
document.addEventListener("resume", onResume, false);
document.addEventListener("pause", onPause, false);
});
function onResume() {
temporizador = setInterval(function() {
admob.requestInterstitialAd({}, function() {
alert('success');
}, function() {
alert('error');
});
}, 5000);
}
function onPause() {
clearInterval(temporizador);
}
it displays on the screen "success", I have no idea what may have happened.
any tips?
I'm using Cordova 6.0.0. After adding this plugin (cordova plugin add admob-ads), I can't build for ios anymore (cordova build ios). Here's the error message:
/Users/arjan/Development/cordova/App.dev/platforms/ios/App/Plugins/admob-ads/CDVAdMobAds.m:101:34: error:
no visible @interface for 'CDVPlugin' declares the selector 'initWithWebView:'
self = (CDVAdMobAds *)[super initWithWebView:theWebView];
~~~~~ ^~~~~~~~~~~~~~~
1 error generated.
** BUILD FAILED **
Any idea what I can do to make it work?
hi i am using ur plugin and it has been working great for me.
However i recently got a bug, i get an js error saying "Uncaught ReferenceError: admob is not defined " and the line which is getting the error is if(admob)
Let me make it clear that it doesn't happen all the time 99.99% of the time it works..it only happens sometimes.
what i don't understand is that if admob is undefined then it should evaluate to false and go to the else but it shows the error.
similar issue is here but it was asked for the incorrect plugin:
https://github.com/floatinghotpot/cordova-plugin-admob/issues/177
function initAds() {
if (admob) {
var adPublisherIds = {
ios : {
banner : "ca-app-pub-xxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxx",
interstitial : "ca-app-pub-xxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxx"
},
android : {
banner : "ca-app-pub-xxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxx",
interstitial : "ca-app-pub-xxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxx"
}
};
var admobid = (/(android)/i.test(navigator.userAgent)) ? adPublisherIds.android : adPublisherIds.ios;
admob.setOptions({
publisherId: admobid.banner,
interstitialAdId: admobid.interstitial
});
registerAdEvents();
} else {
alert('AdMobAds plugin not ready');
}
}
initAds();
// display a banner at startup
admob.createBannerView();
// request an interstitial
admob.requestInterstitialAd();
Kindly let me know when u get around this...thanks
Have you consider port this plugin to NativeScript. Your plutin does well with TabrisJS, but as NativeScript have another approach...
Hello..
I tried to change the size of the ad but it didn't work
I wrote this ( adSize: admob.AD_SIZE.IAB_MRECT ) also I tried to put it between double quotation like this ( adSize: 'admob.AD_SIZE.IAB_MRECT' ) but it also didn't work, any idea why?
I also tried to replace the method IAB_MRECT with MEDIUM_RECTANGLE from google (can be found here : https://developers.google.com/mobile-ads-sdk/docs/admob/android/banner#size)
P.S.: I'm using phonegap build with version 3.3.0 of phonegap, and I'm testing on Sony Xperia z2
when i use this plugin, it saids:
03-13 00:44:11.672: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAdListener>
03-13 00:44:11.672: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAdListener>
03-13 00:44:11.672: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAdListener>
03-13 00:44:11.672: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAdListener>
03-13 00:44:11.672: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAdListener>
03-13 00:44:11.672: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAdListener>
03-13 00:44:11.672: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAdListener>
03-13 00:44:11.672: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAdListener>
03-13 00:44:11.672: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAdListener>
03-13 00:44:11.682: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAdListener>
03-13 00:44:11.682: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAppPurchaseListener>
03-13 00:44:11.682: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAppPurchaseListener>
03-13 00:44:11.682: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAppPurchaseListener>
03-13 00:44:11.682: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAppPurchaseListener>
03-13 00:44:11.682: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAdListener>
03-13 00:44:11.682: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAdListener>
03-13 00:44:11.682: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAdListener>
03-13 00:44:11.682: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAdListener>
03-13 00:44:11.682: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAdListener>
03-13 00:44:11.682: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAdListener>
03-13 00:44:11.682: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAdListener>
03-13 00:44:11.692: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAdListener>
03-13 00:44:11.692: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAppPurchaseListener>
03-13 00:44:11.692: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAppPurchaseListener>
03-13 00:44:11.692: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAppPurchaseListener>
03-13 00:44:11.692: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAppPurchaseListener>
03-13 00:44:11.692: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAdListener>
03-13 00:44:11.692: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAdListener>
03-13 00:44:11.702: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAdListener>
03-13 00:44:11.702: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAdListener>
03-13 00:44:11.702: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAdListener>
03-13 00:44:11.702: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAdListener>
03-13 00:44:11.702: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAdListener>
03-13 00:44:11.702: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAdListener>
03-13 00:44:11.702: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAdListener>
03-13 00:44:11.702: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAdListener>
03-13 00:44:11.702: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAdListener>
03-13 00:44:11.702: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAdListener>
03-13 00:44:11.702: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAdListener>
03-13 00:44:11.712: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAdListener>
03-13 00:44:11.712: W/System.err(26170): java.lang.NoClassDefFoundError: com.appfeel.cordova.admob.AdMobAdsAdListener
03-13 00:44:11.712: W/System.err(26170): at com.appfeel.cordova.admob.AdMobAds.(AdMobAds.java:101)
03-13 00:44:11.712: W/System.err(26170): at java.lang.reflect.Constructor.newInstance(Native Method)
03-13 00:44:11.712: W/System.err(26170): at java.lang.Class.newInstance(Class.java:1606)
03-13 00:44:11.712: W/System.err(26170): at org.apache.cordova.PluginManager.instantiatePlugin(PluginManager.java:493)
03-13 00:44:11.712: W/System.err(26170): at org.apache.cordova.PluginManager.getPlugin(PluginManager.java:170)
03-13 00:44:11.712: W/System.err(26170): at org.apache.cordova.PluginManager.exec(PluginManager.java:123)
03-13 00:44:11.712: W/System.err(26170): at org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:59)
03-13 00:44:11.712: W/System.err(26170): at org.apache.cordova.engine.SystemExposedJsApi.exec(SystemExposedJsApi.java:41)
03-13 00:44:11.712: W/System.err(26170): at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
03-13 00:44:11.712: W/System.err(26170): at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:39)
03-13 00:44:11.712: W/System.err(26170): at android.os.Handler.dispatchMessage(Handler.java:102)
03-13 00:44:11.712: W/System.err(26170): at android.os.Looper.loop(Looper.java:135)
03-13 00:44:11.712: W/System.err(26170): at android.os.HandlerThread.run(HandlerThread.java:61)
03-13 00:44:11.712: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAdListener>
03-13 00:44:11.712: W/System.err(26170): java.lang.NoClassDefFoundError: com.appfeel.cordova.admob.AdMobAdsAdListener
03-13 00:44:11.712: W/System.err(26170): at com.appfeel.cordova.admob.AdMobAds.(AdMobAds.java:101)
03-13 00:44:11.712: W/System.err(26170): at java.lang.reflect.Constructor.newInstance(Native Method)
03-13 00:44:11.712: W/System.err(26170): at java.lang.Class.newInstance(Class.java:1606)
03-13 00:44:11.712: W/System.err(26170): at org.apache.cordova.PluginManager.instantiatePlugin(PluginManager.java:493)
03-13 00:44:11.712: W/System.err(26170): at org.apache.cordova.PluginManager.getPlugin(PluginManager.java:170)
03-13 00:44:11.712: W/System.err(26170): at org.apache.cordova.PluginManager.exec(PluginManager.java:123)
03-13 00:44:11.712: W/System.err(26170): at org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:59)
03-13 00:44:11.712: W/System.err(26170): at org.apache.cordova.engine.SystemExposedJsApi.exec(SystemExposedJsApi.java:41)
03-13 00:44:11.712: W/System.err(26170): at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
03-13 00:44:11.712: W/System.err(26170): at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:39)
03-13 00:44:11.712: W/System.err(26170): at android.os.Handler.dispatchMessage(Handler.java:102)
03-13 00:44:11.712: W/System.err(26170): at android.os.Looper.loop(Looper.java:135)
03-13 00:44:11.712: W/System.err(26170): at android.os.HandlerThread.run(HandlerThread.java:61)
03-13 00:44:11.722: I/art(26170): Rejecting re-init on previously-failed class java.lang.Class<com.appfeel.cordova.admob.AdMobAdsAdListener>
03-13 00:44:11.722: W/System.err(26170): java.lang.NoClassDefFoundError: com.appfeel.cordova.admob.AdMobAdsAdListener
03-13 00:44:11.722: W/System.err(26170): at com.appfeel.cordova.admob.AdMobAds.(AdMobAds.java:101)
03-13 00:44:11.722: W/System.err(26170): at java.lang.reflect.Constructor.newInstance(Native Method)
03-13 00:44:11.722: W/System.err(26170): at java.lang.Class.newInstance(Class.java:1606)
03-13 00:44:11.722: W/System.err(26170): at org.apache.cordova.PluginManager.instantiatePlugin(PluginManager.java:493)
03-13 00:44:11.722: W/System.err(26170): at org.apache.cordova.PluginManager.getPlugin(PluginManager.java:170)
03-13 00:44:11.722: W/System.err(26170): at org.apache.cordova.PluginManager.exec(PluginManager.java:123)
03-13 00:44:11.722: W/System.err(26170): at org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:59)
03-13 00:44:11.722: W/System.err(26170): at org.apache.cordova.engine.SystemExposedJsApi.exec(SystemExposedJsApi.java:41)
03-13 00:44:11.722: W/System.err(26170): at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
03-13 00:44:11.722: W/System.err(26170): at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:39)
03-13 00:44:11.722: W/System.err(26170): at android.os.Handler.dispatchMessage(Handler.java:102)
03-13 00:44:11.722: W/System.err(26170): at android.os.Looper.loop(Looper.java:135)
03-13 00:44:11.722: W/System.err(26170): at android.os.HandlerThread.run(HandlerThread.java:61)
admob object is exists but not working i think. this is the js code:
document.addEventListener('deviceready', function() {
console.log('device ready');
console.log(admob);
// Set AdMobAds options:
admob.setOptions({
publisherId: "myid", // Required
//interstitialAdId: "ca-app-pub-XXXXXXXXXXXXXXXX/IIIIIIIIII", // Optional
//tappxIdiOs: "/XXXXXXXXX/Pub-XXXX-iOS-IIII", // Optional
//tappxIdAndroid: "/XXXXXXXXX/Pub-XXXX-Android-AAAA", // Optional
//tappxShare: 0.5 // Optional
});
// Start showing banners (atomatic when autoShowBanner is set to true)
admob.createBannerView();
// Request interstitial (will present automatically when autoShowInterstitial is set to true)
admob.requestInterstitialAd();
});
used latest cordova. no related issues found. what should i do?
Hi, i add this plugin, Im using phonegap 6.2.4 and the command "phonegap run android" to test it on my phone, but when i try to run it send me the following error:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Landroid/support/annotat
ion/AnimRes;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:594)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:552)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:533)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:170)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:188)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:43
9)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:287)
at com.android.dx.command.dexer.Main.run(Main.java:230)
at com.android.dx.command.dexer.Main.main(Main.java:199)
at com.android.dx.command.Main.main(Main.java:103)FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':transformClassesWithDexForDebug'.com.android.build.api.transform.TransformException: com.android.ide.common.pro
cess.ProcessException: org.gradle.process.internal.ExecException: Process 'comma
nd 'C:\Program Files\Java\jdk1.8.0_66\bin\java.exe'' finished with non-zero exit
value 2Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.BUILD FAILED
Total time: 3 mins 57.818 secs
Error: Error code 1 for command: cmd with args: /s,/c,"C:\wamp\www\phonegap_neta
s\platforms\android\gradlew cdvBuildDebug -b C:\wamp\www\phonegap_netas\platform
s\android\build.gradle -PcdvBuildArch=arm -Dorg.gradle.daemon=true -Pandroid.use
DeprecatedNdk=true"
Can somebody tell me whats wrong
Thanks a lot
When I added
com.admob.google 4.0.7
and
com.danielcwilson.plugins.googleanalytics
to my project after execution of $cordova build I get the following error
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/analytics/internal/Command$1;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:594)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:552)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:533)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:170)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:188)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:439)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:287)
at com.android.dx.command.dexer.Main.run(Main.java:230)
at com.android.dx.command.dexer.Main.main(Main.java:199)
at com.android.dx.command.Main.main(Main.java:103)
:dexDebug FAILED
I found out that this is a problem with multiple dependency, but can I solve this in anyway?
Thanks!
Build with Intel XDK R2611
cordova-admob/CDVAdMobAds.h:31:9: fatal error: 'GoogleMobileAds/GADAdSize.h' file not found
Hi
Great plug-in. Finding it really useful.
One thing I have noticed is that when isTesting = true, I still see real adverts when running in the iOS simulator.
I have done some research and have the following suggestion to contribute.
The release notes for "SDK for AdX Users on iOS" (see https://developers.google.com/mobile-ads-sdk/docs/adx/ios/rel-notes) say
7.2.1 2015‑04‑30
"Simulators once again load live ads by default. Add kGADSimulatorID to the testDevices property on GADRequest to get test ads on simulators."
I modified __buildAdRequest in CDVAdMobAds.m near line 704 so it looks like
request.testDevices =
[NSArray arrayWithObjects:
admobDeviceId, kGADSimulatorID, @"dabe...snip...2b3e",
nil];
Now when isTesting = true, I see test adverts when using the iOS simulator as well as when running on my iPad (UUID beginning dabe etc).
This is not my area of expertise, but I wonder if a change along the lines of what I have suggested might be worth considering.
Best wishes
Mike
Hi, this is not working on android.
I took the test project and remove all the functionalities in order to create a blank and basic app with adds, it works in iOS (emulator and real device), but not in android.
Im getting the following errors in Cordova using Visual Studio 2015:
missing exec:AdMobAds.createBannerView
TypeError: Cannot read property 'createBannerView' of undefined
at Object.exec
at Object.admob.createBannerView
at onDeviceReady
Please help
each time the apk is buit the demo files also gets included adding extra 3mb to the apk file. is there a way to skip the png files ? or maybe i think they should not be there in the first place.
Hi there!
A couple weeks back this worked great, but now when I build, I am getting the following errors:
Error: [xcode-build] Compile /tmp/builds/eEVkkQzlBDFmHqJIIW/app/Cordova350/Plugins/tappx-phonegap/CDVAdMobAds.m: In file included from /tmp/builds/eEVkkQzlBDFmHqJIIW/app/Cordova350/Plugins/tappx-phonegap/CDVAdMobAds.m:29:
In file included from /tmp/builds/eEVkkQzlBDFmHqJIIW/app/Cordova350/Plugins/tappx-phonegap/CDVAdMobAds.h:33:
Cordova350/Plugins/com.ios.libgoogleadmobads/GoogleMobileAds.framework/Headers/GADInterstitial.h:24:80: error: expected ':'
Error: [xcode-build] Compile /tmp/builds/eEVkkQzlBDFmHqJIIW/app/Cordova350/Plugins/tappx-phonegap/CDVAdMobAdsAdListener.m: In file included from /tmp/builds/eEVkkQzlBDFmHqJIIW/app/Cordova350/Plugins/tappx-phonegap/CDVAdMobAdsAdListener.m:28:
In file included from /tmp/builds/eEVkkQzlBDFmHqJIIW/app/Cordova350/Plugins/tappx-phonegap/CDVAdMobAds.h:33:
Cordova350/Plugins/com.ios.libgoogleadmobads/GoogleMobileAds.framework/Headers/GADInterstitial.h:24:80: error: expected ':'
Error: 'Build failed with error code 2'
Just wanted to bring it to your attention.
Is it possible to add keywords when using this plugin, for targeting purposes?
Link to Google's documentation:
https://developers.google.com/android/reference/com/google/android/gms/ads/AdRequest.Builder.html#addKeyword(java.lang.String)
app demo run testAdMob_main() and 1 alert show "admob plugin not ready".
please help me. i try on device Sony xperia Z1 and PhoneGap develop,
While this isn't an issue, I'm curious to know if there is an admob specific function to check if an ad is already created and is being displayed on the screen. Something like admob.isVisibleBannerView()?
Because of the way the project I'm working on is set up, something like this would help. I don't like hitting a page and seeing the ad being re-rendered.
I apologize if this isn't the place to ask.
Sean
I've been working on this for about 3 hours now and I've given up. I've used AdMob on Android Studio, Xamarin Studio, and Unity before with different plugins--no issues. I've been following tutorial after tutorial and trying everything I can in the documentation and I can't figure out what I'm doing wrong. I have the code below, and when the app loads on my phone--Samsung Galaxy Note 3--nothing happens. No banner is loaded. I'm not saying this doesn't work, I'm just saying I don't think it's as easy as presented with added a few lines of code because I can't get it to work for myself.
function onDeviceReady() {
document.removeEventListener('deviceready', onDeviceReady, false);
document.addEventListener('pause', onPause.bind(this), false);
document.addEventListener('resume', onResume.bind(this), false);
admob.setOptions({
publisherId: "ca-app-pub-XX",
bannerAtTop: true, // set to true, to put banner at top
overlap: true, // set to true, to allow banner overlap webview
offsetStatusBar: true, // set to true to avoid ios7 status bar overlap
isTesting: true, // receiving test ads (do not test with real ads as your account will be banned)
autoShowBanner: true // auto show banners ad when loaded
});
admob.createBannerView();
};
Hi -
We love this plug in. It's been a huge help for a project we are trying to get off the ground.
One snag we hit...as we build using "Phone Gap Build"
It gives us this error
"Error - A plugin in your app does not support the compulsory arm64 (64-bit support) architecture"
Any thoughts on a resolution? (I saw the other (closed) issue regarding PGB...but I think this used to actually used to work)
Thanks!
--Josh
it's obvious the file is not there and i guess admob policies wont allow you to run admob.js on chrome. However is it possible to run admob on both chrome and android but show ads only if the device is a mobile.
The reason is currently i prefer running the app on chrome when testing. It's kinda annoying to remove and re add the admob code every time i test on Android.
I have a Phonegap Build created app that uses jquery.mobile, and am using the timed interstitial ads (function onAdLoaded). The problem is, every time I load a new page, it seems to reset the timer and shows an ad immediately. How can I prevent that, and keep the timer on schedule?
Can you please make some options to change the background color of the ad?
My app layout has some light texture, and I want the app background to be white in color.
Also the text ads are not aligned to the center - they align to left, which looks very bad :-(
Can you please let me know how to fix it.
Thanks a lot for coding this plugin for us :) 👍
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.