[AC-6012] requestAD failure in Alloy
GitHub Issue | n/a |
Type | Bug |
Priority | n/a |
Status | Resolved |
Resolution | Needs more info |
Resolution Date | 2018-11-29T23:54:32.000+0000 |
Affected Version/s | Appcelerator Studio 4.3.0 |
Fix Version/s | n/a |
Components | Appcelerator Modules |
Labels | n/a |
Reporter | alejandro_capel |
Assignee | Shak Hossain |
Created | 2018-11-07T06:22:00.000+0000 |
Updated | 2018-11-29T23:54:33.000+0000 |
Description
Hi,
I'm trying use the admod module in android alloy app and I'm taking an issue. (No problem in IOS with same code).
This is my error code:
ERROR] : TiExceptionHandler: (main) [75,2102] /alloy/controllers/home.js:957
[ERROR] : TiExceptionHandler: $.containerAdmod.requestAd();
[ERROR] : TiExceptionHandler: ^
[ERROR] : TiExceptionHandler: Error: Attempt to invoke virtual method 'void ti.admob.View.requestAd(org.appcelerator.kroll.KrollDict)' on a null object reference
I´m not sure what is the problem.Please can you help me? I think is a problem how I'm using this module in alloy but I'm not sure. I have searching in google but i couldn´t find a sample with this implementation.
Thanks in advance!
Regards.
Attachments
Please, any sample with admob module using alloy in android? Thanks!!!
Hello, Thanks for your feedback. Are you using studio 4.3.0? Can you try [this](https://github.com/appcelerator-modules/ti.admob/tree/master/android/example) one on android classic ? If it works for you on android, please convert this code to alloy.
Hi, Yes, Sure. I tested in classic and it was sucesfully. No problem with ios alloy environemt. The Problem is when a call to method requestAd() for recovering the view. If I don´t use this method in code there is no error but obviously app doen´t show the admod view. Please, i have been searching in google but I couldn´t find a sample of using this component with Alloy in Android. Do you have any sample?. It´s a pity in sample component there is not a sample code. Thanks in advance.
Hello, Thanks for your feedback. Can you please share your complete environment details and console logs on a separate text file here? Need to check that.
[^build_android.log] home.xml :
adUnitId
will be used to test adType: Admob.AD_TYPE_BANNER, adUnitId: _publisherid, // You can get your own at http: //www.admob.com/ contentURL: 'http://www.alexcmobile.com', // URL string for a webpage whose content matches the app content. adBackgroundColor: 'transparent', gender: Admob.GENDER_MALE, // GENDER_MALE or GENDER_FEMALE, default: undefined keywords: ['Mythology', 'Gods'] }); adView.addEventListener(Admob.AD_RECEIVED, function() { Ti.API.info('Did receive ad!'); }); adView.addEventListener(Admob.AD_NOT_RECEIVED, function(e) { Ti.API.info('Failed to receive ad: ' + e.error); }); //here the error adMobView.requestAd(); $.containerAdmod.add(adView); }Thanks for your feedback. We checked your file. Unable to find any error message. Can you please double check?
Hi again, Yes, the error doesn't write in log file. It´s happens in runtime. I'm not sure this one is due to using Alloy. The error is right here: adMobView.requestAd() . As you can see, Alloy's view has not yet been opened, which is just the next line in the code -> $.containerAdmod.add(adView); What is the meaning of this error? [ERROR] : TiExceptionHandler: Error: Attempt to invoke virtual method 'void ti.admob.View.requestAd(org.appcelerator.kroll.KrollDict)' on a null object reference . its seems the poblem comes with View, rigth? Thanks.
Hello, Thanks for your feedback. Please share your full test project here to reproduce the issue on our end.
OK. I send u a custom project with alloy functionality. In another file , the error in emulator. Please let me know any question. Thanks in advance.
[~alexcc], Thanks for your feedback. Tested your issue and its works as expected on android device. See attachment section for output. Download the sample test project from [here](https://www.dropbox.com/s/bhpkvt4vi8gvu58/testAlloy.zip?dl=0),run on your environment and let us know how it goes.
Hi Rakhi, I have loaded your program in device and I have the error however now I have a very large trace. [^error alloy in device.rtf] Its seems the reason is : [INFO] : zygote64: Caused by: java.lang.ClassNotFoundException: Didn't find class "android.webkit.TracingController" on path: DexPathList[[zip file "/data/app/com.android.chrome-PijQzE41jAPf1Jo6KRDwGg==/base.apk"],nativeLibraryDirectories=[/data/app/com.android.chrome-PijQzE41jAPf1Jo6KRDwGg==/lib/arm64, /data/app/com.android.chrome-PijQzE41jAPf1Jo6KRDwGg==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]] [INFO Can you have a look ,please? thanks
Hello, Can you share the "appc ti setup check" log in here? Thanks.