question

Doodah avatar image
Doodah asked

Web Console Uncaught TypeError

We're working on Amazon Mobile Ads extension for the marmalade framework. We're using test ads on a Kindle Fire HD. "Some times", everything works fine - we get ads, show them, hide them, refresh them. But other times they don't work at all. The listener says we've got an ad, but it's not showing, or sometimes it shows for a second and then disappears. This is what the log says (error at the bottom): =========== [b]08-22 10:55:13.462: D/AmazonMobileAds AdLayout(2174): Ad size to be determined automatically. 08-22 10:55:13.477: D/AmazonMobileAds AdRequest(2174): Generated AAX url: http://aax-us-east.amazon-adsystem.com/x/msdk?appId=sample-app-v1_pub-2&sz=auto&slot=portrait&ua=Mozilla%2F5.0%20%28Linux%3B%20U%3B%20Android%204.0.3%3B%20en-us%3B%20KFTT%20Build%2FIML74K%29%20AppleWebKit%2F534.30%20%28KHTML%2C%20like%20Gecko%29%20Version%2F4.0%20Safari%2F534.30&adsdk=amznAdSDK-android-5.1.14&dinfo=%7B%22scalingFactor%22%3A%221.5%22%2C%22screenSize%22%3A%22800x1280%22%2C%22orientation%22%3A%22portrait%22%2C%22os%22%3A%22Android%22%2C%22model%22%3A%22KFTT%22%2C%22osVersion%22%3A%224.0.3%22%2C%22connectionType%22%3A%22Wifi%22%2C%22language%22%3A%22en%22%2C%22make%22%3A%22Amazon%22%2C%22country%22%3A%22US%22%7D&pkg=%7B%22v%22%3A%221000003%22%2C%22lbl%22%3A%22Bubble%20Bust%20AM%21%22%2C%22vn%22%3A%221.03%22%2C%22pn%22%3A%22com.gameon.bubblebustsd%22%7D&isTest=true&ad-id=AwK24znw4EZxj0yNrJ2zAsE&sha1_udid=5a9d586f01d9a247f99448cea328b19e0290bbe5&mxsz=800x0 08-22 10:55:13.962: D/AmazonMobileAds AdLoader(2174): ad Contents: 08-22 10:55:13.962: D/AmazonMobileAds AdLoader(2174): 08-22 10:55:13.962: D/AmazonMobileAds AdLoader(2174): 08-22 10:55:13.962: D/AmazonMobileAds AdLoader(2174): 08-22 10:55:13.962: D/AmazonMobileAds AdLoader(2174): 08-22 10:55:13.962: D/AmazonMobileAds AdLoader(2174): 08-22 10:55:13.962: D/AmazonMobileAds AdLoader(2174): 08-22 10:55:13.962: D/AmazonMobileAds AdLoader(2174): 08-22 10:55:13.962: D/AmazonMobileAds AdLoader(2174):
08-22 10:55:13.962: D/AmazonMobileAds AdLoader(2174):
08-22 10:55:13.962: D/AmazonMobileAds AdLoader(2174): 08-22 10:55:13.962: D/AmazonMobileAds AdLoader(2174):
08-22 10:55:13.962: D/AmazonMobileAds AdLoader(2174):
08-22 10:55:13.962: D/AmazonMobileAds AdLoader(2174):
08-22 10:55:13.962: D/AmazonMobileAds AdLoader(2174): 08-22 10:55:13.962: D/AmazonMobileAds AdLoader(2174):
08-22 10:55:13.962: D/AmazonMobileAds AdLoader(2174): 08-22 10:55:13.962: D/AmazonMobileAds AdLoader(2174):
08-22 10:55:13.962: D/AmazonMobileAds AdLoader(2174):
08-22 10:55:13.962: D/AmazonMobileAds AdLoader(2174): 08-22 10:55:13.962: D/AmazonMobileAds AdLoader(2174): 08-22 10:55:13.962: D/AmazonMobileAds AdLoader(2174): 08-22 10:55:13.962: D/AmazonMobileAds AdLoader(2174):
08-22 10:55:13.962: D/AmazonMobileAds AdLoader(2174):
08-22 10:55:13.962: D/AmazonMobileAds AdLoader(2174): 08-22 10:55:13.962: D/AmazonMobileAds AdLoader(2174): 08-22 10:55:13.962: D/AmazonMobileAds AdLoader(2174): 08-22 10:55:13.962: D/AmazonMobileAds AdLoader(2174): 08-22 10:55:13.962: D/AmazonMobileAds AdLoader(2174): 08-22 10:55:13.962: D/AmazonMobileAds AdLoader(2174): 08-22 10:55:13.962: D/AmazonMobileAds AdController(2174): Creating new renderer 08-22 10:55:13.970: D/AmazonMobileAds AdRenderer(2174): Scaling Params: scalingDensity: 1.500000, windowWidth: 800, windowHeight: 0, adWidth: 900, adHeight: 135, scale: 0.888889 08-22 10:55:13.970: D/WebCore(2174): *-* Start browser instrument 08-22 10:55:13.970: D/WebCore(2174): *-* Start browser instrument 08-22 10:55:13.985: D/AmazonMobileAds MraidView(2174): Loaded resource: file:///data/data/com.gameon.bubblebustsd/files/amazon_ads_mraid.js 08-22 10:55:13.985: D/chromium(2174): Unknown chromium error: -6 08-22 10:55:13.993: D/WebCore(2174): *-* Total load time: 22.95 ms, thread time: 18.00 ms for about:blank 08-22 10:55:13.993: D/WebCore(2174): Only uptill WebViewCoreTimeCounter it is part of webcore thread time 08-22 10:55:13.993: D/WebCore(2174): Rest of the timecounters are part of either UI thread or TextureGenrators(TG) thread 08-22 10:55:13.993: D/WebCore(2174): Webkit TexGen thread time: 0.00 ms, Webkit UI thread time: 0.00 ms 08-22 10:55:13.993: D/WebCore(2174): *-* Total css parsing time: 0.00 ms/percent webcore 0.00 called 6 times 08-22 10:55:13.993: D/WebCore(2174): *-* Total javascript time: 0.00 ms/percent webcore 0.00 08-22 10:55:13.993: D/WebCore(2174): *-* Total javascript init time: 9.00 ms/percent webcore 50.00 called 1 times 08-22 10:55:13.993: D/WebCore(2174): *-* Total javascript parsing time: 1.00 ms/percent webcore 5.56 called 2 times 08-22 10:55:13.993: D/WebCore(2174): *-* Total javascript execution time: 1.00 ms/percent webcore 5.56 called 2 times 08-22 10:55:13.993: D/WebCore(2174): *-* Total calculate style time: 0.00 ms/percent webcore 0.00 called 2 times 08-22 10:55:13.993: D/WebCore(2174): *-* Total Java callback (frame bridge) time: 9.00 ms/percent webcore 50.00 called 9 times 08-22 10:55:13.993: D/WebCore(2174): *-* Total parsing (may include calcStyle, Java callback or inline script execution) time: 1.00 ms/percent webcore 5.56 called 1 times 08-22 10:55:13.993: D/WebCore(2174): *-* Total layout time: 1.00 ms/percent webcore 5.56 called 1 times 08-22 10:55:13.993: D/WebCore(2174): *-* Total native 1 (frame bridge) time: 9.00 ms/percent webcore 50.00 called 3 times 08-22 10:55:13.993: D/WebCore(2174): *-* Total native 2 (resource load) time: 0.00 ms/percent webcore 0.00 08-22 10:55:13.993: D/WebCore(2174): *-* Total native 3 (shared timer) time: 11.00 ms/percent webcore 61.11 called 1 times 08-22 10:55:13.993: D/WebCore(2174): *-* Total build nav (webview core) time: 0.00 ms/percent webcore 0.00 called 1 times 08-22 10:55:13.993: D/WebCore(2174): *-* Total record content (webview core) time: 0.00 ms/percent webcore 0.00 08-22 10:55:13.993: D/WebCore(2174): *-* Total native 4 (webview core) time: 0.00 ms/percent webcore 0.00 called 4 times 08-22 10:55:13.993: D/WebCore(2174): *-* Total draw content (webview ui) time: 0.00 ms 08-22 10:55:13.993: D/WebCore(2174): *-* Total tryUpdateQueueWithBitmap (TransferQueue) time: 0.00 ms 08-22 10:55:13.993: D/WebCore(2174): *-* Total blitTileFromQueue (TransferQueue) time: 0.00 ms 08-22 10:55:13.993: D/WebCore(2174): *-* Total webkit_TG_CPU time: 0.00 ms 08-22 10:55:13.993: D/WebCore(2174): *-* Total webkit_UI_CPU time: 0.00 ms 08-22 10:55:13.993: D/WebCore(2174): Current cache has 1144864 bytes live and 204289 bytes dead 08-22 10:55:13.993: D/WebCore(2174): Current render arena takes 4099 bytes 08-22 10:55:13.993: D/WebCore(2174): Current CSS styles use 373380 bytes 08-22 10:55:13.993: D/WebCore(2174): Current DOM nodes use 346672 bytes 08-22 10:55:14.001: D/AmazonMobileAds MraidView(2174): Fire changes: {screenSize: { width: 533, height: 853 }, viewable: false} 08-22 10:55:14.001: D/AmazonMobileAds MraidView(2174): Fire change: {state: 'default'} 08-22 10:55:14.001: D/AmazonMobileAds MraidView(2174): Fire change: {placementType: 'inline'} 08-22 10:55:14.001: D/AmazonMobileAds AdController(2174): adLoaded 08-22 10:55:14.001: D/AmazonMobileAds MraidView(2174): Fire change: {viewable: true} 08-22 10:55:14.001: D/S3EAMA(2174): S3EAMA BannerListener onAdLoaded 08-22 10:55:14.001: D/S3EAMA(2174): S3EAMA onBannerAdLoaded 08-22 10:55:14.001: E/Web Console(2174): Uncaught TypeError: Cannot call method 'fireChangeEvent' of undefined at null:1 08-22 10:55:14.009: E/Web Console(2174): Uncaught TypeError: Cannot call method 'fireChangeEvent' of undefined at null:1 08-22 10:55:14.009: E/Web Console(2174): Uncaught TypeError: Cannot call method 'fireChangeEvent' of undefined at null:1 08-22 10:55:14.009: E/Web Console(2174): Uncaught TypeError: Cannot call method 'fireReadyEvent' of undefined at null:1 08-22 10:55:14.009: E/Web Console(2174): Uncaught TypeError: Cannot call method 'fireChangeEvent' of undefined at null:1 ===========[/b] This is the initialization: [b]AdRegistration.setAppKey(appKey); mBannerListener = new BannerListener(this); mBannerView = new AdLayout(LoaderActivity.m_Activity); mBannerView.setListener(mBannerListener); LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT); mBannerView.setLayoutParams(lp); LoaderActivity.m_Activity.addContentView(mBannerView, lp); mBannerView.setVisibility(View.GONE);[/b] Loading and displaying an ad: [b]mBannerView.setVisibility(View.VISIBLE); mBannerView.loadAd(new AdTargetingOptions());[/b] , after which the above output is written to the console.
mobile ads
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Doodah avatar image
Doodah answered
And all of a sudden (no changes made) it starts working again. As far as I can tell, it's even the same ad that failed to display a while ago. Any clues? [b]08-22 11:16:36.680: D/AmazonMobileAds AdLayout(4578): Ad size to be determined automatically. 08-22 11:16:36.688: D/AmazonMobileAds AdRequest(4578): Generated AAX url: http://aax-us-east.amazon-adsystem.com/x/msdk?appId=sample-app-v1_pub-2&sz=auto&slot=portrait&ua=Mozilla%2F5.0%20%28Linux%3B%20U%3B%20Android%204.0.3%3B%20en-us%3B%20KFTT%20Build%2FIML74K%29%20AppleWebKit%2F534.30%20%28KHTML%2C%20like%20Gecko%29%20Version%2F4.0%20Safari%2F534.30&adsdk=amznAdSDK-android-5.1.14&dinfo=%7B%22scalingFactor%22%3A%221.5%22%2C%22screenSize%22%3A%22800x1280%22%2C%22orientation%22%3A%22portrait%22%2C%22os%22%3A%22Android%22%2C%22model%22%3A%22KFTT%22%2C%22osVersion%22%3A%224.0.3%22%2C%22connectionType%22%3A%22Wifi%22%2C%22language%22%3A%22en%22%2C%22make%22%3A%22Amazon%22%2C%22country%22%3A%22US%22%7D&pkg=%7B%22v%22%3A%221000003%22%2C%22lbl%22%3A%22Bubble%20Bust%20AM%21%22%2C%22vn%22%3A%221.03%22%2C%22pn%22%3A%22com.gameon.bubblebustsd%22%7D&isTest=true&ad-id=AwK24znw4EZxj0yNrJ2zAsE&sha1_udid=5a9d586f01d9a247f99448cea328b19e0290bbe5&mxsz=800x119 08-22 11:16:37.009: D/AmazonMobileAds AdLoader(4578): ad Contents: 08-22 11:16:37.009: D/AmazonMobileAds AdLoader(4578): 08-22 11:16:37.009: D/AmazonMobileAds AdLoader(4578): 08-22 11:16:37.009: D/AmazonMobileAds AdLoader(4578): 08-22 11:16:37.009: D/AmazonMobileAds AdLoader(4578): 08-22 11:16:37.009: D/AmazonMobileAds AdLoader(4578): 08-22 11:16:37.009: D/AmazonMobileAds AdLoader(4578): 08-22 11:16:37.009: D/AmazonMobileAds AdLoader(4578): 08-22 11:16:37.009: D/AmazonMobileAds AdLoader(4578):
08-22 11:16:37.009: D/AmazonMobileAds AdLoader(4578):
08-22 11:16:37.009: D/AmazonMobileAds AdLoader(4578): 08-22 11:16:37.009: D/AmazonMobileAds AdLoader(4578):
08-22 11:16:37.009: D/AmazonMobileAds AdLoader(4578):
08-22 11:16:37.009: D/AmazonMobileAds AdLoader(4578):
08-22 11:16:37.009: D/AmazonMobileAds AdLoader(4578): 08-22 11:16:37.009: D/AmazonMobileAds AdLoader(4578):
08-22 11:16:37.009: D/AmazonMobileAds AdLoader(4578): 08-22 11:16:37.009: D/AmazonMobileAds AdLoader(4578):
08-22 11:16:37.009: D/AmazonMobileAds AdLoader(4578):
08-22 11:16:37.009: D/AmazonMobileAds AdLoader(4578): 08-22 11:16:37.009: D/AmazonMobileAds AdLoader(4578): 08-22 11:16:37.009: D/AmazonMobileAds AdLoader(4578): 08-22 11:16:37.009: D/AmazonMobileAds AdLoader(4578):
08-22 11:16:37.009: D/AmazonMobileAds AdLoader(4578):
08-22 11:16:37.009: D/AmazonMobileAds AdLoader(4578): 08-22 11:16:37.009: D/AmazonMobileAds AdLoader(4578): 08-22 11:16:37.009: D/AmazonMobileAds AdLoader(4578): 08-22 11:16:37.009: D/AmazonMobileAds AdLoader(4578): 08-22 11:16:37.009: D/AmazonMobileAds AdLoader(4578): 08-22 11:16:37.009: D/AmazonMobileAds AdLoader(4578): 08-22 11:16:37.009: D/AmazonMobileAds AdController(4578): Creating new renderer 08-22 11:16:37.016: D/webviewglue(4578): nativeDestroy view: 0x13eb258 08-22 11:16:37.016: D/WebCore(4578): *-* Start browser instrument 08-22 11:16:37.016: D/AmazonMobileAds AdRenderer(4578): Scaling Params: scalingDensity: 1.500000, windowWidth: 800, windowHeight: 119, adWidth: 900, adHeight: 135, scale: 0.881481 08-22 11:16:37.024: D/WebCore(4578): *-* Start browser instrument 08-22 11:16:37.055: D/WebCore(4578): *-* Total load time: 27.46 ms, thread time: 21.00 ms for about:blank 08-22 11:16:37.055: D/WebCore(4578): Only uptill WebViewCoreTimeCounter it is part of webcore thread time 08-22 11:16:37.055: D/WebCore(4578): Rest of the timecounters are part of either UI thread or TextureGenrators(TG) thread 08-22 11:16:37.055: D/WebCore(4578): Webkit TexGen thread time: 0.00 ms, Webkit UI thread time: 0.00 ms 08-22 11:16:37.055: D/WebCore(4578): *-* Total css parsing time: 1.00 ms/percent webcore 4.76 called 6 times 08-22 11:16:37.055: D/WebCore(4578): *-* Total javascript time: 0.00 ms/percent webcore 0.00 08-22 11:16:37.055: D/AmazonMobileAds MraidView(4578): Fire changes: {screenSize: { width: 533, height: 853 }, viewable: false} 08-22 11:16:37.055: D/WebCore(4578): *-* Total javascript init time: 8.00 ms/percent webcore 38.10 called 1 times 08-22 11:16:37.055: D/WebCore(4578): *-* Total javascript parsing time: 1.00 ms/percent webcore 4.76 called 4 times 08-22 11:16:37.055: D/WebCore(4578): *-* Total javascript execution time: 3.00 ms/percent webcore 14.29 called 4 times 08-22 11:16:37.055: D/AmazonMobileAds MraidView(4578): Fire change: {state: 'default'} 08-22 11:16:37.055: D/WebCore(4578): *-* Total calculate style time: 0.00 ms/percent webcore 0.00 called 2 times 08-22 11:16:37.055: D/WebCore(4578): *-* Total Java callback (frame bridge) time: 12.00 ms/percent webcore 57.14 called 8 times 08-22 11:16:37.055: D/WebCore(4578): *-* Total parsing (may include calcStyle, Java callback or inline script execution) time: 7.00 ms/percent webcore 33.33 called 1 times 08-22 11:16:37.055: D/AmazonMobileAds MraidView(4578): Fire change: {placementType: 'inline'} 08-22 11:16:37.055: D/AmazonMobileAds AdController(4578): adLoaded 08-22 11:16:37.055: D/WebCore(4578): *-* Total layout time: 1.00 ms/percent webcore 4.76 called 1 times 08-22 11:16:37.055: D/WebCore(4578): *-* Total native 1 (frame bridge) time: 12.00 ms/percent webcore 57.14 called 3 times 08-22 11:16:37.055: D/WebCore(4578): *-* Total native 2 (resource load) time: 0.00 ms/percent webcore 0.00 08-22 11:16:37.055: D/AmazonMobileAds MraidView(4578): Fire change: {viewable: true} 08-22 11:16:37.055: D/WebCore(4578): *-* Total native 3 (shared timer) time: 0.00 ms/percent webcore 0.00 08-22 11:16:37.055: D/S3EAMA(4578): S3EAMA BannerListener onAdLoaded 08-22 11:16:37.055: D/S3EAMA(4578): S3EAMA onBannerAdLoaded[/b]
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Jsmarcus, Thank you for reporting the issue. Could you try to reproduce the same issue in "SimpleAdSample" that comes with the Ads SDK?
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
I can see that you are are doing this, mBannerView.setVisibility(View.GONE); Where are you making mBannerView as visible?
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Doodah avatar image
Doodah answered
We don't show ads all the time, that's why we hide the view. Would it better to create a view when ads are to be shown and then remove it completely when we don't want ads? Anyhow, we weren't on the UI thread when using the banner view. Haven't seen the error since that was fixed, so hopefully everything works as is should now. Might this have been the cause?
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Jsmarcus, No. What you are you doing is correct. There is no need of creating new view for Ads as such. Please report back if you face any issue with ad display in the test mode. If enableTesting = true, you should always see an ad regardless of which country you are in.
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.