当前位置: 代码迷 >> Android >> Android常见有关问题及其解决方法
  详细解决方案

Android常见有关问题及其解决方法

热度:80   发布时间:2016-05-01 19:53:09.0
Android常见问题及其解决办法

今天在向模拟器部署运行项目时碰到下面的异常:

?

[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);
  相关解决方案