Home  >  Forum  >  Android
Post New Query

SecurityException: Permission denied (missing INTERNET permission?)


joined on
November 02,2014
Asked on November 02,2014
Hi, I am creating android application to consume XML data using Spring Rest API. Facing below issue.

java.lang.RuntimeException: Unable to start activity java.lang.SecurityException: Permission denied (missing INTERNET permission?) 11-01 17:18:11.710: E/AndroidRuntime(1296): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2197) 11-01 17:18:11.710: E/AndroidRuntime(1296): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2258) 11-01 17:18:11.710: E/AndroidRuntime(1296): at android.app.ActivityThread.access$800(ActivityThread.java:138) 11-01 17:18:11.710: E/AndroidRuntime(1296): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1209) 11-01 17:18:11.710: E/AndroidRuntime(1296): at android.os.Handler.dispatchMessage(Handler.java:102) 11-01 17:18:11.710: E/AndroidRuntime(1296): at android.os.Looper.loop(Looper.java:136) 11-01 17:18:11.710: E/AndroidRuntime(1296): at android.app.ActivityThread.main(ActivityThread.java:5026) 11-01 17:18:11.710: E/AndroidRuntime(1296): at java.lang.reflect.Method.invokeNative(Native Method) 11-01 17:18:11.710: E/AndroidRuntime(1296): at java.lang.reflect.Method.invoke(Method.java:515) 11-01 17:18:11.710: E/AndroidRuntime(1296): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777) 11-01 17:18:11.710: E/AndroidRuntime(1296): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602) 11-01 17:18:11.710: E/AndroidRuntime(1296): at dalvik.system.NativeStart.main(Native Method) 11-01 17:18:11.710: E/AndroidRuntime(1296): Caused by: java.lang.SecurityException: Permission denied (missing INTERNET permission?) 11-01 17:18:11.710: E/AndroidRuntime(1296): at java.net.InetAddress.lookupHostByName(InetAddress.java:418) 11-01 17:18:11.710: E/AndroidRuntime(1296): at java.net.InetAddress.getAllByNameImpl(InetAddress.java:236) 11-01 17:18:11.710: E/AndroidRuntime(1296): at java.net.InetAddress.getAllByName(InetAddress.java:214) 11-01 17:18:11.710: E/AndroidRuntime(1296): at com.android.okhttp.internal.Dns$1.getAllByName(Dns.java:28) 11-01 17:18:11.710: E/AndroidRuntime(1296): at com.android.okhttp.internal.http.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:216) 11-01 17:18:11.710: E/AndroidRuntime(1296): at com.android.okhttp.internal.http.RouteSelector.next(RouteSelector.java:122) 11-01 17:18:11.710: E/AndroidRuntime(1296): at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:292) 11-01 17:18:11.710: E/AndroidRuntime(1296): at com.android.okhttp.internal.http.HttpEngine.sendSocketRequest(HttpEngine.java:255) 11-01 17:18:11.710: E/AndroidRuntime(1296): at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:206) 11-01 17:18:11.710: E/AndroidRuntime(1296): at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:351) 11-01 17:18:11.710: E/AndroidRuntime(1296): at com.android.okhttp.internal.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:90) 11-01 17:18:11.710: E/AndroidRuntime(1296): at org.springframework.http.client.SimpleBufferingClientHttpRequest.executeInternal(SimpleBufferingClientHttpRequest.java:72) 11-01 17:18:11.710: E/AndroidRuntime(1296): at org.springframework.http.client.AbstractBufferingClientHttpRequest.executeInternal(AbstractBufferingClientHttpRequest.java:46) 11-01 17:18:11.710: E/AndroidRuntime(1296): at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:63) 11-01 17:18:11.710: E/AndroidRuntime(1296): at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:476) 11-01 17:18:11.710: E/AndroidRuntime(1296): at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:439) 11-01 17:18:11.710: E/AndroidRuntime(1296): at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:237)
joined on
October 10,2013
Replied on November 02,2014

You need to add

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

in your AndroidManifest.xml
joined on
November 02,2014
Replied on November 02,2014

Thanks for quick response.

It worked.

Write Answer



Sitewide-Feb4of4234x60





Copyright ©2017 concretepage.com, all rights reserved |Privacy Policy | Contact Us