开发者

Facebook Android SDK unknownHostException

Facebook Android SDK when running example apps gives

11-14 23:17:58.484: ERROR/HttpOperation.run(1139): class java.net.UnknownHostException api.facebook.com [http://api.facebook.com/restserver.php?api_key=882a8490361da98702bf97a021ddc14d&call_id=1289744278460&format=JSON&method=fql.query&migrations_override=%7B%27empty_json%27%3A+true%7D&query=SELECT+uid%2Cfirst_name%2Clast_name%2Cname%2Cpic_square%2Ccell%2Cother_phone%2Ccontact_email%2Cbirthday_date+FROM+user+WHERE+%28uid+IN+%28SELECT+uid2+FROM+friend+WHERE+uid1%3D1825058169%29%29%3B&session_key=f9902bc179f7592f8ed273ed-1825058169&sig=e299638eb114e77fef3eb2088f270683&v=1.0]
11-14 23:17:58.484: ERROR/HttpOperation(1139): Encountered exception: java.net.UnknownHostException: api.facebook.com
11-14 23:17:58.484: WARN/System.err(1139): java.net.UnknownHostException: api.facebook.com
11-14 23:17:58.484: WARN/System.err(1139): at java.net.InetAddress.lookupHostByName(InetAddress.java:513)
11-14 23:17:58.484: WARN/System.err(1139): at java.net.In开发者_如何学GoetAddress.getAllByNameImpl(InetAddress.java:278)
11-14 23:17:58.484: WARN/System.err(1139): at java.net.InetAddress.getAllByName(InetAddress.java:242)
11-14 23:17:58.484: WARN/System.err(1139): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:136)
11-14 23:17:58.484: WARN/System.err(1139): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
11-14 23:17:58.484: WARN/System.err(1139): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
11-14 23:17:58.484: WARN/System.err(1139): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348)
11-14 23:17:58.484: WARN/System.err(1139): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
11-14 23:17:58.484: WARN/System.err(1139): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
11-14 23:17:58.484: WARN/System.err(1139): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
11-14 23:17:58.484: WARN/System.err(1139): at com.facebook.katana.service.method.HttpOperation.run(HttpOperation.java:163)


You need to add the permission to use the internet to the app. If you don't, the app throws this error.

go into the manifest and add this line:

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


I was getting these errors on my phone. I went to

settings > applications > manage applicatoins > facebook > clear data.

That fixed the problems on my phone.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜