weird exceptions under android 4.0 with eclipse

2019-01-23 18:48发布

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)

3条回答
萌系小妹纸
2楼-- · 2019-01-23 19:12

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

查看更多
别忘想泡老子
3楼-- · 2019-01-23 19:28

@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.

查看更多
叛逆
4楼-- · 2019-01-23 19:32

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

查看更多
登录 后发表回答