今天在向模拟器部署运行项目时碰到下面的异常:
?
[2012-02-15 13:22:14 - DeviceMonitor] Adb connection Error:An existing connection was forcibly closed by the remote host
[2012-02-15 13:22:14 - Unexpected error while launching logcat. Try reselecting the device.] An existing connection was forcibly closed by the remote host
java.io.IOException: An existing connection was forcibly closed by the remote host
两种解决办法:
1、在命令行下执行如下命令:adb kill-server、adb kill-server
2、在任务管理器中,强制关闭adb.exe,然后重启模拟器
1 楼 cyhcheng 2012-02-15
运行项目碰到下面的异常:
E/dalvikvm(293): Unable to open stack trace file '/data/anr/traces.txt': Permission denied
这种情况通常是代码问题,比如上下文环境的问题,如下面的代码,删除红色部分则会出现上面的异常:
convertView = LayoutInflater.from(getApplicationContext()).inflate(R.layout.baseadapter_provider, null);
TextView mTextView = (TextView) convertView.findViewById(R.id.textview);
Button button = (Button) convertView.findViewById(R.id.button1);
ImageView imageView = (ImageView) convertView.findViewById(R.id.imageView);
E/dalvikvm(293): Unable to open stack trace file '/data/anr/traces.txt': Permission denied
这种情况通常是代码问题,比如上下文环境的问题,如下面的代码,删除红色部分则会出现上面的异常:
convertView = LayoutInflater.from(getApplicationContext()).inflate(R.layout.baseadapter_provider, null);
TextView mTextView = (TextView) convertView.findViewById(R.id.textview);
Button button = (Button) convertView.findViewById(R.id.button1);
ImageView imageView = (ImageView) convertView.findViewById(R.id.imageView);