I got a report of this exception from 1 user even though I have the permission in the manifest
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
I had this problem as well... when building against an earlier API, I was simply getting an unhandledException
thrown, which I noticed when stepping over the getAllNetworkInfo()
or getActiveNetworkInfo()
. However, nothing was actually shown in logcat. When building against the newest API (22), I got the above-mentioned SecurityException
.
For me, the solution turned out to be that I had written
<uses-permission android:name="ANDROID.PERMISSION.INTERNET" />
<uses-permission android:name="ANDROID.PERMISSION.ACCESS_NETWORK_STATE" />
when instead I needed
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
So, to any developer experiencing this issue and scratching his head, please note that these permission names are case sensitive!
I solved moving the uses-permission just below the manifest tag
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With