Target won't connect from MRAID in-app ad, Android 4.4.4, MoPub SDK

69 views
Skip to first unread message

Ilan Arad

unread,
Mar 24, 2015, 5:36:52 AM3/24/15
to wei...@googlegroups.com
Peace, all,

Trying to debug an "HTML5 ad" (MRAID) that MoPub's SDK pops up from an Android app.
Target does not connect -- Weinre's --debug doesn't show it.

I'm injecting "http://foo:8080/target/target-script-min.js" dynamically, with document.head.appendChild(), and script's onload fires, so I'm guessing there must be an error in the script, or maybe XHR problems?
Everything works from a browser target (ie, same page/code opened in the Android browser).
(Server is running elsewhere in LAN, thus weird domain -- just hostname.)

Without Weinre's debugging abilities, developing the ad will be, nu, pure hell.

Ideas how to proceed to debug this?

Thanks!
;o)

Patrick Mueller

unread,
Mar 24, 2015, 8:01:45 AM3/24/15
to wei...@googlegroups.com
First off, no chance you can use Android's built-in debugging?  More info here: https://developer.chrome.com/devtools/docs/remote-debugging

Wondering if there's something different about the environment.  Like, you can't use XHR.  Or JavaScript!  Sorry, don't know anything about MRAID or MoPub.

Another option is that weinre for some reason can't find it's script tag, to figure out where the server is ("foo:8080").  Usually the server is determined by looking for the script tag for the target script.  You can override this with globals:

* WeinreServerURL
* WeinreServerId

The `WeinreServerId` is the hash bit on the URL.  Defaults to "anonymous", and you're not using it, so you shouldn't need to set it to anything.

Also try adding --verbose and --debug to your server startup, and perhaps you'll catch some kind of error message, if it actually connects but then later dies for some other reason.  

Ilan Arad

unread,
Mar 24, 2015, 12:35:10 PM3/24/15
to wei...@googlegroups.com
Peace, Patrick,

Thanks for this! ;o)

First off, no chance you can use Android's built-in debugging?  

I'll look into it. Nevertheless, I like Weinre's pure web approach.  ;o)

something different about the environment [...] can't use XHR or JavaScript

Apparently, something *is* different, because *everything* works in the phone's browser.
 
option is that weinre for some reason can't find it's script tag [...] override this with globals:
* WeinreServerURL

I'll try, but as I said, script's "onload" fires and handled by me (just to give some UI feedback), so I can't think why Weinre's getElementsByTagName("script") shouldn't find it.
 
try adding --verbose and --debug to your server startup

I did. Nothing heard from the target. (The serving of the script asset (by middleware?) is apparently never shown; would've indicated if network's fault.)
 
Nu. Not sure my current project will let me research this further, but if so, I'll report back.
Thanks!

Reply all
Reply to author
Forward
0 new messages