ThrottleService(79): unable reading network stats

2019-03-22 04:43发布

问题:

I am getting Exception " ThrottleService(79): problem reading network stats"
I don't know why this is giving me exception and in the App there is some communication with server which is working fine but the XMPP packet listener which was working in past, is not working now. Can anybody tell me what is wrong ?
Please help me, Thanks in advance.

The XMPP shows the device is logged in and is online on server.

My environment :

Server Side :

OS :Windows
XMPP Server : Openfire 3.7.1.
Apache tomcat 6
Java 6

Client side :

Android 4.0.3
For XMPP I am using Smack Library

What should I do? I am stuck to this point.

Hear are logs from deprecated log-cat :---

11-23 11:46:11.932: WARN/ThrottleService(79): unable to find stats for iface rmnet0
11-23 11:46:11.932: WARN/ThrottleService(79): [ 11-23 11:47:58.421    79:0x74 F/NetworkStats ]
11-23 11:46:11.932: WARN/ThrottleService(79): problem reading network stats
11-23 11:46:11.932: WARN/ThrottleService(79): java.lang.IllegalStateException: problem parsing idx 1
11-23 11:46:11.932: WARN/ThrottleService(79):     at com.android.internal.net.NetworkStatsFactory.readNetworkStatsDetail(NetworkStatsFactory.java:300)
11-23 11:46:11.932: WARN/ThrottleService(79):     at com.android.server.NetworkManagementService.getNetworkStatsUidDetail(NetworkManagementService.java:1282)
11-23 11:46:11.932: WARN/ThrottleService(79):     at com.android.server.net.NetworkStatsService.performPollLocked(NetworkStatsService.java:831)
11-23 11:46:11.932: WARN/ThrottleService(79):     at com.android.server.net.NetworkStatsService.performPoll(NetworkStatsService.java:799)
11-23 11:46:11.932: WARN/ThrottleService(79):     at com.android.server.net.NetworkStatsService.access$100(NetworkStatsService.java:128)
11-23 11:46:11.932: WARN/ThrottleService(79):     at com.android.server.net.NetworkStatsService$3.onReceive(NetworkStatsService.java:633)
11-23 11:46:11.932: WARN/ThrottleService(79):     at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:728)
11-23 11:46:11.932: WARN/ThrottleService(79):     at android.os.Handler.handleCallback(Handler.java:605)
11-23 11:46:11.932: WARN/ThrottleService(79):     at android.os.Handler.dispatchMessage(Handler.java:92)
11-23 11:46:11.932: WARN/ThrottleService(79):     at android.os.Looper.loop(Looper.java:137)
11-23 11:46:11.932: WARN/ThrottleService(79):     at android.os.HandlerThread.run(HandlerThread.java:60)
11-23 11:46:11.932: WARN/ThrottleService(79): Caused by: java.io.FileNotFoundException: /proc/net/xt_qtaguid/stats: open failed: ENOENT (No such file or directory)
11-23 11:46:11.932: WARN/ThrottleService(79):     at libcore.io.IoBridge.open(IoBridge.java:406)
11-23 11:46:11.932: WARN/ThrottleService(79):     at java.io.FileInputStream.<init>(FileInputStream.java:78)
11-23 11:46:11.932: WARN/ThrottleService(79):     at com.android.internal.net.NetworkStatsFactory.readNetworkStatsDetail(NetworkStatsFactory.java:269)
11-23 11:46:11.932: WARN/ThrottleService(79):     ... 10 more
11-23 11:46:11.932: WARN/ThrottleService(79): Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
11-23 11:46:11.932: WARN/ThrottleService(79):     at libcore.io.Posix.open(Native Method)
11-23 11:46:11.932: WARN/ThrottleService(79):     at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
11-23 11:46:11.932: WARN/ThrottleService(79):     at libcore.io.IoBridge.open(IoBridge.java:390)
11-23 11:46:11.932: WARN/ThrottleService(79):     ... 12 more

回答1:

This has happened to me when I accidentally removed the following line from the manifest:

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Once I added it back there everything came back to normal.

I hope this helps.