6

Here are my Manifest file

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.pa4ad.earthquakeviewer" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="11" android:targetSdkVersion="21" /> <uses-permission android:name="android.permisson.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name=".Earthquake" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest> 

I tested these code on a Nexus 7 1st generation, not an emulator. After a complete search online, I found solutions to similar questions and have added the permission INTERNET and ACCESS_NETWORK_STATE, but still get this error.

 03-25 11:15:49.909: E/AndroidRuntime(27298): java.lang.SecurityException: Permission denied (missing INTERNET permission?) 03-25 11:15:49.909: E/AndroidRuntime(27298): at java.net.InetAddress.lookupHostByName(InetAddress.java:451) 03-25 11:15:49.909: E/AndroidRuntime(27298): at java.net.InetAddress.getAllByNameImpl(InetAddress.java:252) 03-25 11:15:49.909: E/AndroidRuntime(27298): at java.net.InetAddress.getAllByName(InetAddress.java:215) 03-25 11:15:49.909: E/AndroidRuntime(27298): at com.android.okhttp.HostResolver$1.getAllByName(HostResolver.java:29) 03-25 11:15:49.909: E/AndroidRuntime(27298): at com.android.okhttp.internal.http.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:232) 03-25 11:15:49.909: E/AndroidRuntime(27298): at com.android.okhttp.internal.http.RouteSelector.next(RouteSelector.java:124) 03-25 11:15:49.909: E/AndroidRuntime(27298): at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:272) 03-25 11:15:49.909: E/AndroidRuntime(27298): at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:211) 03-25 11:15:49.909: E/AndroidRuntime(27298): at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:382) 03-25 11:15:49.909: E/AndroidRuntime(27298): at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:332) 03-25 11:15:49.909: E/AndroidRuntime(27298): at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:500) 
5
  • I have deleted the app on Nexus 7 and re-install with the complete code above, but it still doesn't work. Commented Mar 25, 2015 at 16:43
  • Are you using an IDE, like Android Studio? The spelling error in permission should be highlighted for you. Commented Mar 25, 2015 at 17:07
  • Thank you. But I have "permission" corrected, app deleted and re-installed and I still get the same errors. Commented Mar 25, 2015 at 20:58
  • I use Eclipse Juno as the IDE, but there was no build errors caused by the misspelling of the "permission". Commented Mar 25, 2015 at 20:58
  • I copied the line with the incorrect spelling permisson :) Commented Sep 28, 2020 at 17:05

2 Answers 2

12

there is a spelling mistake in permission

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

use this

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

Ref: http://developer.android.com/training/basics/network-ops/connecting.html

Sign up to request clarification or add additional context in comments.

4 Comments

@Ahmed what do mean? is there any problem with my answer?
No. What I meant was I am surprised that the typo did not raise a build error for Anderson.
Thank you. But I have "permission" corrected, app deleted and re-installed and I still get the same errors.
@Anderson try cleaning UR project and re run
2

grant internet permission:

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.