android 4.0下eclipse的奇怪异常

发布于 2024-12-17 20:33:49 字数 2211 浏览 0 评论 0原文

当我使用 eclipse 开发我的 android 项目时,logCat 总是打印这些类型的警告,但应用程序运行正常,任何人都可以告诉我发生了什么事。

11-23 18:17:35.802: A/NetworkStats(87): problem reading network stats
11-23 18:17:35.802: A/NetworkStats(87): java.lang.IllegalStateException: problem parsing line: null
11-23 18:17:35.802: A/NetworkStats(87):     at com.android.internal.net.NetworkStatsFactory.readNetworkStatsDetail(NetworkStatsFactory.java:313)
11-23 18:17:35.802: A/NetworkStats(87):     at com.android.server.NetworkManagementService.getNetworkStatsUidDetail(NetworkManagementService.java:1223)
11-23 18:17:35.802: A/NetworkStats(87):     at com.android.server.net.NetworkStatsService.performPollLocked(NetworkStatsService.java:810)
11-23 18:17:35.802: A/NetworkStats(87):     at com.android.server.net.NetworkStatsService.performPoll(NetworkStatsService.java:771)
11-23 18:17:35.802: A/NetworkStats(87):     at com.android.server.net.NetworkStatsService.access$100(NetworkStatsService.java:128)
11-23 18:17:35.802: A/NetworkStats(87):     at com.android.server.net.NetworkStatsService$3.onReceive(NetworkStatsService.java:610)
11-23 18:17:35.802: A/NetworkStats(87):     at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:728)
11-23 18:17:35.802: A/NetworkStats(87):     at android.os.Handler.handleCallback(Handler.java:605)
11-23 18:17:35.802: A/NetworkStats(87):     at android.os.Handler.dispatchMessage(Handler.java:92)
11-23 18:17:35.802: A/NetworkStats(87):     at android.os.Looper.loop(Looper.java:137)
11-23 18:17:35.802: A/NetworkStats(87):     at android.os.HandlerThread.run(HandlerThread.java:60)
11-23 18:17:35.802: A/NetworkStats(87): Caused by: java.io.FileNotFoundException: /proc/net/xt_qtaguid/stats: open failed: ENOENT (No such file or directory)
11-23 18:17:35.802: A/NetworkStats(87):     at libcore.io.IoBridge.open(IoBridge.java:406)
11-23 18:17:35.802: A/NetworkStats(87):     at java.io.FileInputStream.<init>(FileInputStream.java:78)
11-23 18:17:35.802: A/NetworkStats(87):     at java.io.FileReader.<init>(FileReader.java:42)
11-23 18:17:35.802: A/NetworkStats(87):     at com.android.internal.net.NetworkStatsFactory.readNetworkStatsDetail(NetworkStatsFactory.java:272)

when i using eclipse to develop my android project , the logCat always print these kinds of warnings , but the app runs ok , can any one tell me what has happened.

11-23 18:17:35.802: A/NetworkStats(87): problem reading network stats
11-23 18:17:35.802: A/NetworkStats(87): java.lang.IllegalStateException: problem parsing line: null
11-23 18:17:35.802: A/NetworkStats(87):     at com.android.internal.net.NetworkStatsFactory.readNetworkStatsDetail(NetworkStatsFactory.java:313)
11-23 18:17:35.802: A/NetworkStats(87):     at com.android.server.NetworkManagementService.getNetworkStatsUidDetail(NetworkManagementService.java:1223)
11-23 18:17:35.802: A/NetworkStats(87):     at com.android.server.net.NetworkStatsService.performPollLocked(NetworkStatsService.java:810)
11-23 18:17:35.802: A/NetworkStats(87):     at com.android.server.net.NetworkStatsService.performPoll(NetworkStatsService.java:771)
11-23 18:17:35.802: A/NetworkStats(87):     at com.android.server.net.NetworkStatsService.access$100(NetworkStatsService.java:128)
11-23 18:17:35.802: A/NetworkStats(87):     at com.android.server.net.NetworkStatsService$3.onReceive(NetworkStatsService.java:610)
11-23 18:17:35.802: A/NetworkStats(87):     at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:728)
11-23 18:17:35.802: A/NetworkStats(87):     at android.os.Handler.handleCallback(Handler.java:605)
11-23 18:17:35.802: A/NetworkStats(87):     at android.os.Handler.dispatchMessage(Handler.java:92)
11-23 18:17:35.802: A/NetworkStats(87):     at android.os.Looper.loop(Looper.java:137)
11-23 18:17:35.802: A/NetworkStats(87):     at android.os.HandlerThread.run(HandlerThread.java:60)
11-23 18:17:35.802: A/NetworkStats(87): Caused by: java.io.FileNotFoundException: /proc/net/xt_qtaguid/stats: open failed: ENOENT (No such file or directory)
11-23 18:17:35.802: A/NetworkStats(87):     at libcore.io.IoBridge.open(IoBridge.java:406)
11-23 18:17:35.802: A/NetworkStats(87):     at java.io.FileInputStream.<init>(FileInputStream.java:78)
11-23 18:17:35.802: A/NetworkStats(87):     at java.io.FileReader.<init>(FileReader.java:42)
11-23 18:17:35.802: A/NetworkStats(87):     at com.android.internal.net.NetworkStatsFactory.readNetworkStatsDetail(NetworkStatsFactory.java:272)

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

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

发布评论

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

评论(3

未蓝澄海的烟 2024-12-24 20:33:50

@Drax:实际上,你在那里不正确,这取决于所使用的内核版本,事实上,如果你使用的是较旧的内核,例如 2.6.35 或类似版本,你肯定会收到此错误,因为 netfilter内核 3 中的(Linux iptables netfilter 的一部分)具有此功能,目前尚未向后移植到旧内核。

@Drax: Actually, you're not correct there, that is dependent on the kernel version used, in fact, if you're on a older kernel, such as 2.6.35 or thereabouts, you will definitely get this error as the netfilter (part of Linux's iptables netfilter) in Kernel 3 has this feature that is not currently backported to the older kernels.

﹏雨一样淡蓝的深情 2024-12-24 20:33:50

ICS 应该运行的 3.0 内核包含一个 netfilter 模块: xt_qtaguid

它在后台运行并处理所有 PID 的网络使用情况,并向此处的 proc fs 呈现统计报告:
/proc/net/xt_qtaguid/stats

您会在上面的错误中注意到:
Caused by: java.io.FileNotFoundException: /proc/net/xt_qtaguid/stats: open failed: ENOENT (No such file or directory)

这可能是因为您的内核中可能缺少此模块。

只需做一些工作就可以将其向后移植到 2.6.35 内核:
https://github.com/Hashcode/android_device_motorola_solana/tree/ics/modules /netfilter/xt_qtaguid

The 3.0 kernel which ICS is supposed to run on contains a netfilter module: xt_qtaguid

This runs in the background and processes network usage for all PIDs and renders a stat report to the proc fs here:
/proc/net/xt_qtaguid/stats

You'll notice in the error above:
Caused by: java.io.FileNotFoundException: /proc/net/xt_qtaguid/stats: open failed: ENOENT (No such file or directory)

This is probably because you probably are missing this module in your kernel.

It can be backported to the 2.6.35 kernel with a little work:
https://github.com/Hashcode/android_device_motorola_solana/tree/ics/modules/netfilter/xt_qtaguid

友欢 2024-12-24 20:33:50

这是关于网络连接框架的错误。我猜因为你正在使用模拟器。并且您没有连接到任何互联网网络,因此框架正在尝试获取网络状态,但它没有找到任何人并且无法连接

This is the Error Regarding the network connection framework. since you are using Emulator i guess. and you are not connected to the any internet network, so the framework is trying to get the state of the network and it's not finding anyone and failing to connect

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