【问题标题】:Android LogCat continuously repeating a warning: "Addition of standard header .... not allowed"Android LogCat 不断重复警告:“添加标准头......不允许”
【发布时间】:2011-11-30 01:04:51
【问题描述】:

我一直在使用 2.3.3 (API 10) 版本开发 Android 应用程序。该应用程序仅使用 Flickr Java API (flickrj) 根据标签、日期、地理信息等进行某些搜索查询,并将搜索结果照片显示给用户。我已经为此工作了 2 周,并使用我的 HTC Sensation 通过 USB 调试器对其进行调试。今天,不知何故,我开始收到一条恼人的警告消息,在我的 LogCat 中反复循环。如下:

11-30 00:31:43.083: I/org.restlet(22899): Couldn't find the mandatory "Host" HTTP header.
11-30 00:31:43.143: D/com.fd.httpd(22899): sdcard phone type != 1
11-30 00:31:43.143: D/com.fd.httpd(22899): emmc phone type != 1
11-30 00:31:43.163: I/LogService(22899): 2011-11-30 00:31:43    127.0.0.1   -       127.0.0.1   8182    GET /info/  -   200 1143    0   52  http://null -   -
11-30 00:31:43.163: I/Server(22899): Addition of the standard header "pragma" is discouraged as a future versions of the Restlet API will directly support it.
11-30 00:31:43.163: W/Server(22899): Addition of the standard header "cache-control" is not allowed. Please use the equivalent property in the Restlet API.
11-30 00:31:43.163: W/Server(22899): Addition of the standard header "expires" is not allowed. Please use the equivalent property in the Restlet API.

当我关闭或重新启动手机时,警告消息不再循环播放。但是当我开始使用 USB 调试器玩弄我的应用程序时,警告会在一段时间后再次出现。我可以毫无问题地继续开发/调试我的应用程序,但由于这些警告挤满了 LogCat 窗口,因此很难追踪正在发生的事情。

我检查了其他人是否有同样的问题,我得到的唯一线索是检查警告中重复的 pid 号:22899。这个 pid 号属于包“com.fd.httpd” "(HTC Sync 应用程序),这是我设置 USB 驱动程序以使用 PC 进行调试所必需的。但我不知道为什么 HTC Sync 会导致错误。

如果有人能分享他们关于原因和可能解决方案的想法,我会很高兴。感谢您的宝贵时间。

【问题讨论】:

    标签: android debugging synchronization flickrj


    【解决方案1】:

    在 LogCat 中设置过滤器,例如在所有应用程序日志中使用特定标签,并对其进行过滤,这样系统日志就不会让您感到混乱

    【讨论】:

    • 但之前的消息不断被删除。 IE。当所有过滤器中保存的过滤器中有太多消息时,其他过滤器也会开始擦除。 :s
    • 不幸的是,这是因为只有一个 LogCat 缓冲区。但他们应该正在开发新的 ADT 版本。
    • @PeterV 手头的相同问题我在无限循环中遇到 System.err:NoSuch MethodException 等,但是当我连接了设备时。我必须在命令提示符下手动终止设备让循环停止。
    猜你喜欢
    • 1970-01-01
    • 2021-09-08
    • 2013-02-18
    • 2019-07-09
    • 2021-05-03
    • 2013-09-20
    • 2012-01-06
    • 2017-01-07
    • 1970-01-01
    相关资源
    最近更新 更多