Nguyen  Minh Binh Nguyen Minh Binh - 1 year ago 90
Android Question

ACCESS_NETWORK_STATE permisson on Android ICS

I declared the permission ACCESS_NETWORK_STATE in Applicaiton manifest as below.

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

Everything is good on Android 2.x. But on Android ICS, it failed with below log cat. Please help me.

java.lang.SecurityException: ConnectivityService: Neither user 10093
nor current process has android.permission.ACCESS_NETWORK_STATE. at
android.os.Parcel.readException( at
android.os.Parcel.readException( at$Stub$Proxy.getActiveNetworkInfo(
at com.tapfortap.AdView.getNetwork( at
com.tapfortap.AdView.loadAdsWithAppId( at
com.tapfortap.AdView.access$100( at
com.tapfortap.AdView$1$ at
android.os.Handler.handleCallback( at
android.os.Handler.dispatchMessage( at
android.os.Looper.loop( at at
java.lang.reflect.Method.invokeNative(Native Method) at
java.lang.reflect.Method.invoke( at$
at at
dalvik.system.NativeStart.main(Native Method)

Answer Source

This should a bug of Android ICS framework. I just resolved this by add this permission again:

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


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download