Received jsonString: [] in Android

84 views
Skip to first unread message

Paolo Vernazza

unread,
Jan 15, 2012, 11:17:45 AM1/15/12
to adwhir...@googlegroups.com
My application is having some problems in receiving the ads.
The stacktrace is at the end of the message.
I already tried to save the configuration again as I read in some older
posts, but I keep having the same problem.
In the last week my impressions drop to 1/3, that means that non every
device is having this problem, but most of them do.

Paolo Vernazza

01-15 17:06:48.905: D/AdWhirl SDK(24858): Prefs{null}: {"config": "[]
01-15 17:06:48.905: D/AdWhirl SDK(24858): ", "timestamp": 1326643033706}
01-15 17:06:48.905: I/AdWhirl SDK(24858): Using stored config data
01-15 17:06:48.905: D/AdWhirl SDK(24858): Received jsonString: []
01-15 17:06:48.910: E/AdWhirl SDK(24858): Unable to parse response from
JSON. This may or may not be fatal.
01-15 17:06:48.910: E/AdWhirl SDK(24858): org.json.JSONException: Value
[] of type org.json.JSONArray cannot be converted to JSONObject
01-15 17:06:48.910: E/AdWhirl SDK(24858): at
org.json.JSON.typeMismatch(JSON.java:107)
01-15 17:06:48.910: E/AdWhirl SDK(24858): at
org.json.JSONObject.<init>(JSONObject.java:158)
01-15 17:06:48.910: E/AdWhirl SDK(24858): at
org.json.JSONObject.<init>(JSONObject.java:171)
01-15 17:06:48.910: E/AdWhirl SDK(24858): at
com.adwhirl.AdWhirlManager.parseConfigurationString(AdWhirlManager.java:290)
01-15 17:06:48.910: E/AdWhirl SDK(24858): at
com.adwhirl.AdWhirlManager.fetchConfig(AdWhirlManager.java:257)
01-15 17:06:48.910: E/AdWhirl SDK(24858): at
com.adwhirl.AdWhirlLayout$InitRunnable.run(AdWhirlLayout.java:376)
01-15 17:06:48.910: E/AdWhirl SDK(24858): at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:444)
01-15 17:06:48.910: E/AdWhirl SDK(24858): at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
01-15 17:06:48.910: E/AdWhirl SDK(24858): at
java.util.concurrent.FutureTask.run(FutureTask.java:138)
01-15 17:06:48.910: E/AdWhirl SDK(24858): at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:153)
01-15 17:06:48.910: E/AdWhirl SDK(24858): at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:267)
01-15 17:06:48.910: E/AdWhirl SDK(24858): at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
01-15 17:06:48.910: E/AdWhirl SDK(24858): at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
01-15 17:06:48.910: E/AdWhirl SDK(24858): at
java.lang.Thread.run(Thread.java:1019)
01-15 17:06:48.910: I/AdWhirl SDK(24858): Sum of ration weights is 0 -
no ads to be shown

Eric Leichtenschlag

unread,
Jan 18, 2012, 1:40:24 PM1/18/12
to adwhir...@googlegroups.com
It looks like you're having trouble grabbing the config.  What do you get when you ping http://mob.adwhirl.com/getInfo.php?appver=311&appid=YOUR_SDK_KEY when you replace YOUR_SDK_KEY with your actual SDK key?

Eric

Paolo Vernazza

unread,
Jan 18, 2012, 7:06:41 PM1/18/12
to adwhir...@googlegroups.com
Il 18/01/2012 19:40, Eric Leichtenschlag ha scritto:
It looks like you're having trouble grabbing the config.  What do you get when you ping http://mob.adwhirl.com/getInfo.php?appver=311&appid=YOUR_SDK_KEY when you replace YOUR_SDK_KEY with your actual SDK key?

Eric
This is what i get:


{"extra":{"location_on":1,"background_color_rgb":{"red":255,"green":255,"blue":255,"alpha":1},"text_color_rgb":{"red":0,"green":0,"blue":0,"alpha":1},"cycle_time":30,"transition":8},"rations":[{"nid":"7d7e296820644492928c3fa59f10fd6c","type":1,"nname":"admob","weight":100,"priority":1,"key":"a14da6f2c12849d"}]}

Eric Leichtenschlag

unread,
Jan 20, 2012, 2:45:38 PM1/20/12
to adwhir...@googlegroups.com
Hey Paolo,

The configuration you've provided is valid.  Questions: Do you have the correct SDK key in your app (clearly from above you used the correct key when pinging that link)?  Also, are you using the SDK jar, or are you using modified source code?

Looking at the logs again, it says "Prefs{null}", meaning your adWhirlkey is null in the app.  Therefore an invalid request is made to AdWhirl, it returns an empty response, and the error is coming as a result of trying to parse an empty response.

Eric

Paolo Vernazza

unread,
Jan 20, 2012, 7:21:32 PM1/20/12
to adwhir...@googlegroups.com
Ok,
I found the problem.
I'm providing the SDK key through the XML. If I insert the meta-data in
the Activity node, then adwhirl works. If I insert it in the Application
node, Adwhirl doesn't work.
I always had the KEY in the application node and I never had problems.
Now I'm a bit confused, because the adwhirl documentation
(https://www.adwhirl.com/doc/android/AdWhirlAndroidSDKSetup.html)
reports that "this value may now be specified at either the application
or activity level via the XML attribute ADWHIRL_KEY", but the android
documentation
(http://developer.android.com/guide/topics/manifest/meta-data-element.html)
says that the meta-data elements can be in an activity but not in an
application... (to say the truth it doesn't say anything about the
application) so I'm wondering why it ever worked :) I think that it may
depend on the installed sdk (not the targeted one... I tried to target
version 2.1 or 2.2 and it's not working)

Well... I think I'll insert the apikey in every activity ;)

Paolo


Eric Leichtenschlag

unread,
Jan 23, 2012, 12:49:55 PM1/23/12
to adwhir...@googlegroups.com
Hi Paolo,

You are right - the Android documentation fails to mention any support of meta-data at the application level, on both the meta-data tag page and the application tag page. However, I'm still able to make use of the AdWhirl <meta-data/> tag inside <application/> but outside <activity> on both 1.6 and 2.2 emulator.

Perhaps support for meta-data at the application level is device specific, and that is why the Android documentation doesn't include it.  Anyhow, it looks like adding it at the Activity is the safer bet, even though it is not ideal.  Thanks for teaching me something new today.

Eric

John

unread,
Jul 16, 2013, 6:05:47 PM7/16/13
to adwhir...@googlegroups.com
Hi Eric
 
I am getting [] response when I hit http://mob.adwhirl.com/getInfo.php?appver=311&appid=YOUR_SDK_KEY after replacing appid=with the mediation ID. Can you please advise what needs to be done.
 
 
 John

Eric Leichtenschlag

unread,
Jul 26, 2013, 1:28:25 PM7/26/13
to adwhir...@googlegroups.com
You should get something like what Pablo had above:


{"extra":{"location_on":1,"background_color_rgb":{"red":255,"green":255,"blue":255,"alpha":1},"text_color_rgb":{"red":0,"green":0,"blue":0,"alpha":1},"cycle_time":30,"transition":8},"rations":[{"nid":"7d7e296820644492928c3fa59f10fd6c","type":1,"nname":"admob","weight":100,"priority":1,"key":"a14da6f2c12849d"}]}

This config indicated a 30s refresh rate with AdMob targeted 100% and 1st backfill priority with his pub ID. If you have multiple ad networks, you should see multiple ration objects.
Reply all
Reply to author
Forward
0 new messages