Adwhirl android 无法解析 JSON

发布于 2025-01-05 21:34:14 字数 2741 浏览 1 评论 0原文

您好,我收到一条错误消息,指出 adwhirl 无法解析 json 响应 我试图将我的广告加载到 AdwhirlLayout 中,如文档中所述,但它只是告诉我它无法解析 json 数据。

02-13 16:00:20.260: D/AdWhirl SDK(13928): Prefs{null}: {"config": "", "timestamp": 1329144790626}
02-13 16:00:20.260: I/AdWhirl SDK(13928): Using stored config data
02-13 16:00:20.260: D/AdWhirl SDK(13928): Received jsonString: 
02-13 16:00:20.260: E/AdWhirl SDK(13928): Unable to parse response from JSON. This may or may not be fatal.
02-13 16:00:20.260: E/AdWhirl SDK(13928): org.json.JSONException: End of input at character 0 of 
02-13 16:00:20.260: E/AdWhirl SDK(13928):   at org.json.JSONTokener.syntaxError(JSONTokener.java:446)
02-13 16:00:20.260: E/AdWhirl SDK(13928):   at org.json.JSONTokener.nextValue(JSONTokener.java:93)
02-13 16:00:20.260: E/AdWhirl SDK(13928):   at org.json.JSONObject.<init>(JSONObject.java:154)
02-13 16:00:20.260: E/AdWhirl SDK(13928):   at org.json.JSONObject.<init>(JSONObject.java:171)
02-13 16:00:20.260: E/AdWhirl SDK(13928):   at com.adwhirl.AdWhirlManager.parseConfigurationString(AdWhirlManager.java:290)
02-13 16:00:20.260: E/AdWhirl SDK(13928):   at com.adwhirl.AdWhirlManager.fetchConfig(AdWhirlManager.java:257)
02-13 16:00:20.260: E/AdWhirl SDK(13928):   at com.adwhirl.AdWhirlLayout$InitRunnable.run(AdWhirlLayout.java:376)
02-13 16:00:20.260: E/AdWhirl SDK(13928):   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
02-13 16:00:20.260: E/AdWhirl SDK(13928):   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
02-13 16:00:20.260: E/AdWhirl SDK(13928):   at java.util.concurrent.FutureTask.run(FutureTask.java:137)
02-13 16:00:20.260: E/AdWhirl SDK(13928):   at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:150)
02-13 16:00:20.260: E/AdWhirl SDK(13928):   at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:264)
02-13 16:00:20.260: E/AdWhirl SDK(13928):   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1081)
02-13 16:00:20.260: E/AdWhirl SDK(13928):   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:574)
02-13 16:00:20.260: E/AdWhirl SDK(13928):   at java.lang.Thread.run(Thread.java:1020)

我的代码:

AdWhirlLayout adWhirlLayout = (AdWhirlLayout) findViewById(R.id.adwhirlLayout);

    int diWidth = 320;
    int diHeight = 52; 
    int density = (int) getResources().getDisplayMetrics().density;

    adWhirlLayout.setAdWhirlInterface(this);
    adWhirlLayout.setMaxWidth((int) (diWidth * density));
    adWhirlLayout.setMaxHeight((int) (diHeight * density));

我的密钥在 android 清单中指定

Hi im getting a error saying that adwhirl cannot parse json response
Im trying to load my ad into a AdwhirlLayout as stated in the documentation but it just says to me it cannot parse the json data.

02-13 16:00:20.260: D/AdWhirl SDK(13928): Prefs{null}: {"config": "", "timestamp": 1329144790626}
02-13 16:00:20.260: I/AdWhirl SDK(13928): Using stored config data
02-13 16:00:20.260: D/AdWhirl SDK(13928): Received jsonString: 
02-13 16:00:20.260: E/AdWhirl SDK(13928): Unable to parse response from JSON. This may or may not be fatal.
02-13 16:00:20.260: E/AdWhirl SDK(13928): org.json.JSONException: End of input at character 0 of 
02-13 16:00:20.260: E/AdWhirl SDK(13928):   at org.json.JSONTokener.syntaxError(JSONTokener.java:446)
02-13 16:00:20.260: E/AdWhirl SDK(13928):   at org.json.JSONTokener.nextValue(JSONTokener.java:93)
02-13 16:00:20.260: E/AdWhirl SDK(13928):   at org.json.JSONObject.<init>(JSONObject.java:154)
02-13 16:00:20.260: E/AdWhirl SDK(13928):   at org.json.JSONObject.<init>(JSONObject.java:171)
02-13 16:00:20.260: E/AdWhirl SDK(13928):   at com.adwhirl.AdWhirlManager.parseConfigurationString(AdWhirlManager.java:290)
02-13 16:00:20.260: E/AdWhirl SDK(13928):   at com.adwhirl.AdWhirlManager.fetchConfig(AdWhirlManager.java:257)
02-13 16:00:20.260: E/AdWhirl SDK(13928):   at com.adwhirl.AdWhirlLayout$InitRunnable.run(AdWhirlLayout.java:376)
02-13 16:00:20.260: E/AdWhirl SDK(13928):   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
02-13 16:00:20.260: E/AdWhirl SDK(13928):   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
02-13 16:00:20.260: E/AdWhirl SDK(13928):   at java.util.concurrent.FutureTask.run(FutureTask.java:137)
02-13 16:00:20.260: E/AdWhirl SDK(13928):   at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:150)
02-13 16:00:20.260: E/AdWhirl SDK(13928):   at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:264)
02-13 16:00:20.260: E/AdWhirl SDK(13928):   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1081)
02-13 16:00:20.260: E/AdWhirl SDK(13928):   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:574)
02-13 16:00:20.260: E/AdWhirl SDK(13928):   at java.lang.Thread.run(Thread.java:1020)

my code:

AdWhirlLayout adWhirlLayout = (AdWhirlLayout) findViewById(R.id.adwhirlLayout);

    int diWidth = 320;
    int diHeight = 52; 
    int density = (int) getResources().getDisplayMetrics().density;

    adWhirlLayout.setAdWhirlInterface(this);
    adWhirlLayout.setMaxWidth((int) (diWidth * density));
    adWhirlLayout.setMaxHeight((int) (diHeight * density));

my key is specified in android manifest

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

空心空情空意 2025-01-12 21:34:14

我认为 AdWhirl 配置服务器现在已关闭。您可能想在一个小时左右再试一次,希望到那时它已经恢复了。

I think that the AdWhirl config server is down right now. You may want to try it again in an hour or so and hopefully it's back up by that point.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文