Comments (28)
Hi @kerbooo I thing I know what it is.
Could you try this version please?
from ti.android.admob.
@deckameron Hi again. Firstly Thank you for your support. Unfortunately app is crashing When it is opening. I mean it does not open. May be below debug lines can help you. Thank you for your interest.
[WARN] : DynamiteModule: Local module descriptor class for com.google.android.gms.ads.dynamite not found.
[WARN] : System: ClassLoader referenced unknown path:
[WARN] : System: ClassLoader referenced unknown path: /data/user_de/0/com.google.android.gms/app_chimera/m/00000013/n/armeabi-v7a
[WARN] : System: ClassLoader referenced unknown path: /data/user_de/0/com.google.android.gms/app_chimera/m/00000013/n/armeabi
from ti.android.admob.
@kerbooo thank you for the logs.
I will investigate it.
from ti.android.admob.
@deckameron I thank you very much. Have a good job..
from ti.android.admob.
Hi @deckameron did you find problem?
from ti.android.admob.
@kerbooo not yet. I could not reproduce it yet. But I will keep trying...
from ti.android.admob.
@deckameron thank you very much.
from ti.android.admob.
@deckameron Hi again. I need to publish new version for my app. Because of that I have changed my approach but this approach is not so useful. May be this approach can help you.
var Admob = require("ti.android.admob");
exports.FncCreateAdmobInterstitial = function() {
var AdmobInterstitial = Admob.createView({
top : 0,
adSizeType : "INTERSTITIALAD",
publisherId : "xxxxxxxxxxxxxxxxxxxxxxxx", //> USE YOUR PUBLISHER ID HERE
testing : false
});
var _Window = Titanium.UI.createWindow({
backgroundColor : "transparent",
theme : "Theme.AppCompat.Translucent.NoTitleBar",
});
_Window.addEventListener("close", function() {
_LabelForAdvertisement = null;
_Window = null;
});
var _LabelForAdvertisement = Ti.UI.createLabel({
color : "#2222222",
text : "Advertisement",
textAlign : Ti.UI.TEXT_ALIGNMENT_CENTER,
font : {
fontSize : 15
},
zIndex : 0,
backgrounColor: "#000000",
borderRadius: 4,
width: 100,
height: 30
});
_Window.add(_LabelForAdvertisement);
_Window.add(AdmobInterstitial);
_Window.open();
_Window.addEventListener('android:back', function(e) {
e.cancelBubble = true;
return false;
});
AdmobInterstitial.addEventListener('ad_not_received', function(e) {
_Window.close();
});
AdmobInterstitial.addEventListener('ad_ready_to_be_shown', function(e) {
AdmobInterstitial.showAdNow();
});
AdmobInterstitial.addEventListener('ad_being_shown', function(e) {
});
AdmobInterstitial.addEventListener('ad_closed', function(e) {
_Window.close();
});
mylibs.FncCreateAdmobInterstitial();
from ti.android.admob.
@deckameron Could you find a way? Problem source is about closing window before ad load. I mean If you close window before to load ad Interstitial application crash.
from ti.android.admob.
@kerbooo could you try this, please?
Use this version and edit your code like this:
_Window.addEventListener("close", function() {
AdmobInterstitial.destoyAdViewAndCancelRequest();
_LabelForAdvertisement = null;
_Window = null;
});
from ti.android.admob.
@deckameron Unfortunately not. I am getting below error;
[ERROR] : TiExceptionHandler: (main) [261,74748] ----- Titanium Javascript Runtime Error -----
[ERROR] : TiExceptionHandler: (main) [0,74748] - In /globalFunctions.js:92,20
[ERROR] : TiExceptionHandler: (main) [0,74748] - Message: Uncaught Attempt to invoke virtual method 'android.app.Activity org.appcelerator.kroll.KrollProxy.getActivity()' on a null object reference
[ERROR] : TiExceptionHandler: (main) [0,74748] - Source: AdmobInterstitial.destoyAdViewAndCancelRequest(),
[ERROR] : V8Exception: Exception occurred at /globalFunctions.js:92: Uncaught Attempt to invoke virtual method 'android.app.Activity org.appcelerator.kroll.KrollProxy.getActivity()' on a null object reference
[ERROR] : V8Exception: Attempt to invoke virtual method 'android.app.Activity org.appcelerator.kroll.KrollProxy.getActivity()' on a null object reference
from ti.android.admob.
Hi @kerbooo I am in a middle of trip and I can't work on my module right now. I will work on it again when I get back. In the meanwhile, could try something like this code, please?
var Admob = require("ti.android.admob");
exports.FncCreateAdmobInterstitial = function() {
var _Window = Titanium.UI.createWindow({
backgroundColor : "transparent",
theme : "Theme.AppCompat.Translucent.NoTitleBar",
});
_Window.addEventListener("close", function() {
_LabelForAdvertisement = null;
_Window = null;
});
_Window.addEventListener('android:back', function(e) {
AdmobInterstitial.removeEventListener('ad_ready_to_be_shown', adReadyToBeShownCallback);
e.cancelBubble = true;
return false;
});
var adReadyToBeShownCallback = function(e) {
if(_Window && AdmobInterstitial){
AdmobInterstitial.showAdNow();
}
}
var AdmobInterstitial = Admob.createView({
top : 0,
adSizeType : "INTERSTITIALAD",
publisherId : "xxxxxxxxxxxxxxxxxxxxxxxx", //> USE YOUR PUBLISHER ID HERE
testing : false
});
_Window.add(AdmobInterstitial);
AdmobInterstitial.addEventListener('ad_not_received', function(e) {
_Window.close();
});
AdmobInterstitial.addEventListener('ad_ready_to_be_shown', adReadyToBeShownCallback);
AdmobInterstitial.addEventListener('ad_being_shown', function(e) {
});
AdmobInterstitial.addEventListener('ad_closed', function(e) {
_Window.close();
});
var _LabelForAdvertisement = Ti.UI.createLabel({
color : "#2222222",
text : "Advertisement",
textAlign : Ti.UI.TEXT_ALIGNMENT_CENTER,
font : {
fontSize : 15
},
zIndex : 0,
backgrounColor: "#000000",
borderRadius: 4,
width: 100,
height: 30
});
_Window.add(_LabelForAdvertisement);
_Window.open();
};
mylibs.FncCreateAdmobInterstitial();
from ti.android.admob.
@deckameron Unfortunately not too. 3.0.1 and 3.0.2 release are not working. App crash when it opens. 3.0 release is working but last above codes is giving error too. Thank you for your support.
from ti.android.admob.
[WARN] : TiDrawableReference: (main) [645,645] Could not open stream to get bitmap
[WARN] : TiDrawableReference: (main) [1,646] Could not open stream to get bitmap
[WARN] : DynamiteModule: Local module descriptor class for com.google.android.gms.ads.dynamite not found.
[WARN] : System: ClassLoader referenced unknown path:
[WARN] : System: ClassLoader referenced unknown path: /data/user_de/0/com.google.android.gms/app_chimera/m/00000013/n/armeabi-v7a
[WARN] : System: ClassLoader referenced unknown path: /data/user_de/0/com.google.android.gms/app_chimera/m/00000013/n/armeabi
from ti.android.admob.
@deckameron I know I bored you. Could you look this issue?
from ti.android.admob.
@deckameron me again. I know really I bored you. Could you look that?
from ti.android.admob.
Hi @kerbooo
I finally had some time to work on my module again. Could you please try this version?
from ti.android.admob.
Hi @deckameron Unfortunately it does not work too. App crashes when open.
DynamiteModule: Local module descriptor class for com.google.android.gms.ads.dynamite not found.
from ti.android.admob.
@kerbooo are you using these new attributes to create the Interstital View?
publisherId : "ca-app-pub-xxxxxxxxxxxxx~xxxxxxx", //USE YOUR PUBLISHER ID HERE
adUnitId: 'ca-app-pub-xxxxxxxxxxxxx/xxxxxxx', //USE YOUR AD_UNIT ID HERE
from ti.android.admob.
@deckameron I have tried after you wrote but I am sorry, result is same.
from ti.android.admob.
@kerbooo import this project into your workspace and tell me if it works, please.
Don't forget to replace the adUnitId and publisherId for both ads.
from ti.android.admob.
@deckameron Thank you for your effort but result is same. I have extract module from project file and add my project. But app crassh when it was opening. After that import your project my workspace but I get error about SDK version. My project titanium SDK is 7.1.0 GA may be you could tray with SDK 7.1.0 GA.
from ti.android.admob.
Hİ @deckameron, I hope you are fine. Did you try codes with SDK 7.1.0?
from ti.android.admob.
Hi @kerbooo I was very busy with a Geofence Module I was creating for a project and could not work on this one for a few weeks. I will go back to it this weekend. ;-)
from ti.android.admob.
@deckameron thank you very much. I am waiting :) Have nice work.
from ti.android.admob.
Hi @deckameron could you find problem?
from ti.android.admob.
Hi @deckameron Firstly thank you and I am sorry. I was building my project with "run-on-main-thread = false" because of that your module crashing when app was opening. I have changed "run-on-main-thread = true" and it is working now. I am sorry again. Thank you for your support.
from ti.android.admob.
@kerbooo I am glad to know everything is ok.
I will add this info to the module docs. :-)
from ti.android.admob.
Related Issues (20)
- Google Play services resources were not found. HOT 11
- Support to GDPR HOT 19
- Error when compiling app project with Admob Module 3.0.4 HOT 1
- Using banner with listView? HOT 1
- Bluetooth permission? HOT 3
- Android device back button close prevent? HOT 1
- Error using 16.x ti.playservices HOT 7
- Failed resolution of Lcom/google/.../RewardedVideoAdListener HOT 8
- [Android] build fails on Ti SDK 9 cause of new gradle system HOT 2
- Native ads causes app to crash HOT 1
- Native ads in ListView HOT 1
- Error with Ti.Android.Admob and Ti.cloudpush HOT 3
- deleteTCStringIfOutdated stops to work properly for v.2.2.0 HOT 1
- SDK 6.0.0 Support? HOT 8
- Error during build: jarsigner: unable to sign jar HOT 2
- No support for multiple adsizes HOT 7
- Module not found HOT 2
- google-play-services-base.jar version error HOT 17
- Module does not work with SDK less than 7.0.0.GA HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ti.android.admob.