Android和IOException异常 - 奇怪的错误 [英] Android and IOException - strange error

查看:246
本文介绍了Android和IOException异常 - 奇怪的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试着写与HTTP GET请求的基本应用。 Eclipse的验证了我code,但是当我在Android的控制台中使用IOException异常我有这个奇怪的信息:

I'm trying to write a basic application with http get request. Eclipse validated my code, but when I using IOException in Android console I have this strange messages:

trouble writing output: null
[2009-07-29 17:22:49 - myapp] Conversion to Dalvik format failed with error 2

和我的应用程序不加载到仿真器。这是我的code:

And my application doesn't load into the emulator. This is my code:

HttpHost target = new HttpHost("google.com", 80);
HttpGet get = new HttpGet("/");
String result = null;
HttpEntity entity = null;
HttpClient client = new DefaultHttpClient();
try {
    HttpResponse response=client.execute(target, get);
    entity = response.getEntity();
    result = EntityUtils.toString(entity);
} catch (Exception e) {
    e.printStackTrace();
} finally {
    if (entity!=null){}
    	try {
    		entity.consumeContent();
    	} catch (IOException e) {}
}
return result;

任何人都知道这是什么问题?

Anyone knows what is the problem?

推荐答案

这每一个现在,再次弹出,但没有DX错误尚未追查。你有没有-XX:+ AggressiveOpts JVM选项?看到最近的报告:

this pops up every now and again, but no bug in dx has yet been tracked down. do you have the -XX:+AggressiveOpts JVM option? see the most recent report:

<一个href=\"http://$c$c.google.com/p/android/issues/detail?id=5817\">http://$c$c.google.com/p/android/issues/detail?id=5817

和这里的对应于这个计算器页面的bug(我关闭,因为笔者从来没有提供的信息,我们需要重现该问题):

and here's the bug corresponding to this stackoverflow page (which i closed because the author never supplied information we needed to reproduce the problem):

<一个href=\"http://$c$c.google.com/p/android/issues/detail?id=3480\">http://$c$c.google.com/p/android/issues/detail?id=3480

这篇关于Android和IOException异常 - 奇怪的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆