Simulator cannot test advertising. But it’s not required or documented that we have to put some conditional check to see if Simulator is running, if so, don’t call ads related function because it will crash.
Corona should come up and say something about its plan about V2 bugs & documentation.
I haven’t had any other ad or other plugin crash the simulator. I use a bunch of plugins, many of which don’t have any effect on the simulator, but none of them crash it. That fact alone leaves me wondering if the admob V2 plugin wasn’t given the normal test treatment at CL before being released. I don’t really understand the difference in the way plugins are implemented re: Pro vs Enterprise, but it does seem like us Pro users are the ones with the problems with this particular plugin.
I am having similiar results (on Android simulator crashes as on iOS).
Also, when switched to Admob v2 (even without using ads.load/isLoaded), my app crashes (tested on Android device), when I try to post to Facebook - app becomes unresponsible, after change to Admob v1, I can post to Facebook without problems.
iOS: ads.load() does not crash in Simulator or on my device, i just can’t seem to display any Admob interstitials with the V2 plugin (no problem with banners). Using similar codes, Admob V1 no problems with banners or interstitials.
I do get this in the xcode console: <Warning>: <Google:HTML> Google Mobile Ads SDK: You are currently using 6.8.0 of the SDK. A new version, 6.9.2, is available
I submitted a bug, # 33780. Here is the simple code sample I submitted that crashes for me on the simulator. I’m a Pro user using daily 2347 on a Mac. The error message is “…attempt to call field ‘load’ (a nil value)”
main.lua:
-- Test admob crash on simulator local ads = require "ads" adUnitID = "ca-app-pub-1111111111111111111111111111" local function admobListener(event) for k,v in pairs(event) do print("admob event k,v: ",k,v) end end ads.init( "admob", adUnitID , admobListener ) ads.load("interstitial", { appId = adUnitID, testMode = false })
Does this v2 version have anything that allows us to know when an Interstitial is closed so we can start the banners again? I’m having problems with the v1 plugin not showing both at the same time. I had it working, but now it isn’t anymore. If I try to do both, (i relaunch banner after interstitial since it kills it) it just causes both to stop. The banner being called right after interstitial breaks interstitial by aborting it before it shows and then banner never turns back on.
Ok , so I submitted a bug report but accidentley placed my ads.load() etc before my init…
Must remember to check after stripping everything out.
resubmitted.
However it seems to me that the engineers are not aware of this or rather some are not.
I appreciate them looking at the exact issue but surely common sense should have told them; oh hang on a minute this is that bug everyone in the forums talking about?
I am just trying to get something sorted, although I am young I do feel very overpowered by Corona.
Tom has stated and i quote
"
I did run your sample with the correct placement of the code and it runs fine on a Nexus 7 so I don’t see the crash you’re talking about. It did correctly show an ad. We don’t have any other crash reports for Admob.
"
We don’t have any other crash reports for Admob" really? what about this thread ?
I am going to leave this for a while now, I just dont appreciate spending hundreds of dollars to have something not work when it is supposed too.
I have posted my code here if anyone wants to try it:
For those experiencing a crash with ads.load() in the Simulator, you can use the following code.
The Corona Simulator library in missing a stub for the new load() function, which is why it’s crashing.
The following code is a workaround.
local ads = require("ads") ads.init("admob", "your-appID-here" [, optional\_listener]) ads.oldload = ads.load ads.load = function(...) if (type(ads.oldload) == "function") then ads.oldload(unpack(arg)) else local msg = "ads.load() not available" if (system.getInfo("environment") == "simulator") then print(msg.." in the Simulator") else print(msg) end end end
Weird. Now it’s not working when I try to build for iOS. I’m getting this “Unexpected build error” in my Sublime build console when I try to build for device:
/Users/stephenlewis/Desktop/BakeryBatch.app/.build/libtemplate/Builder.lua:310: <error>{“status”:256,“message”:“ld: library not found for -lads-admob\nclang: error: linker command failed with exit code 1 (use -v to see invocation)”}</error>
(1) Why do we need to call ads.load()? (And I have to call it in system suspend event again in order to call ads.load consistently, what a weird implementation!) Android doesn’t need ads.load() to be called, why is the difference? And this method is brought by Corona users not from official document, why is it trustworthy?
(2) Where is the formal documentation?
(3) Why is there no more callbacks in the admob listener? (both successful or failure case, no more callback!)
Corona, could you answer these questions first? I really don’t care if ads.load() crashes in Simulator if these questions can not be answered first because I am really having doubt in using V2 and I strongly believe V2 has to be improved a lot!!!