导出日志cd D:\Android\Sdk\platform-toolsadb shell logcat -d d:\a.txt只能导出开机之后的日志。Android进程运行中权限被收回导致关闭在Android进程还在运行着某些权限却被收回了这就导致进程崩溃被迫关闭。权限收回后进程的id发生了变化是因为运行中的程序在权限被收回后会强制重启。// 杀死并重启进程 fun restartApp(context: Context) { val intent context.packageManager.getLaunchIntentForPackage(context.packageName) val restartIntent PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_ONE_SHOT) // 设置杀死应用后1秒重启 val mgr: AlarmManager context.getSystemService(Context.ALARM_SERVICE) as AlarmManager mgr.set(AlarmManager.RTC, System.currentTimeMillis() 1000, restartIntent) // 重启应用 android.os.Process.killProcess(android.os.Process.myPid()) }1. 在httpConn.connect();时原来正常但又遇到会报Host is unresolved错误重新运行模拟器可能会解决。常在分辨率升高时出现。2.HttpUrlConnection.setRequestProperty();后实际请求的内容中头关键字被小写了。遇到同样问题的 http://hi.baidu.com/jiawei_liu/blog/item/3997b002f1e2bf0a1c95836d.html#03.CookieSyncManager.setCookie()常不起作用但在它执行前断点或者睡眠能解决。4.i7680上如果使用new出来的TextView或WebView输入框可能会弹不出来改为在xml中配置可解决。5.emulator-5554 disconnected! Cancelling尝试window - Show Views - Other - Android - device - view menu - Reset adbhttp://www.cnblogs.com/over140/archive/2010/08/06/1793264.html或者尝试 debug configrations,勾上Wipe User Data.或者 加参数 -wipe-datahttp://dev.10086.cn/cmdn/bbs/redirect.php?tid1420gotolastpost6.执行Drawable drawable getResources().getDrawable(R.drawable.seperate);时出错查看LogCat中的打印发现12-17 05:10:25.534: WARN/ResourceType(463): getEntry failing because entryIndex 12 is beyond type entryCount 1212-17 05:10:25.534: WARN/ResourceType(463): Failure getting entry for 0x7f02000c (t1 e12) in package 0: 0x80000001清理重新编译解决。7.android.view.WindowManager$BadTokenException: Unable to add window -- token android.app.LocalActivityManager$LocalActivityRecord453e05d0 is not valid; is your activity running?导致报这个错是在于new AlertDialog.Builder(mcontext)虽然这里的参数是AlertDialog.Builder(Context context)但不能使用getApplicationContext()获得的Context,而必须使用Activity,因为只有一个Activity才能添加一个窗体。使用getLocalActivityManager启动的activity也不行。可以用以下代码解决privateContext getDialogContext(){ Context context; if(getParent()!null) context getParent(); else contextthis; return context;}8.Android 的调试信息分为五类VERBOSE 类型调试信息verbose啰嗦的意思DEBUG 类型调试信息, debug调试信息INFO 类型调试信息, 一般提示性的消息informationWARN 类型调试信息warning警告类型信息ERROR 类型调试信息错误信息在LogCat中选择显示级别表示最低的显示级别而不是只显示这一级别。9. android模拟器中FileExplorer不显示问题方法1打开DDMS模式找到左上角的Devices模块下面的图标从右往左第二个图标上面写着STOP的标记一般界面不显示的原因都是由于它启动的原因停止它然后会看到FileExplorer和LogCat都正常显示了。方法2重启虚拟机。方法3重启Eclipse和虚拟机。10. 更新代码后编译报AndroidManifest.xml does not declare a Java package: Build aborted.刷新工程后编译。11. 在Android tools/Export...生成导出安装文件时报 Conversion to Dalvik format failed with error 1在D:\android-sdk_r10-windows\tools\proguard\bin目录找到proguard.bat把call %java_exe% -jar quot;%PROGUARD_HOME%quot;\lib\proguard.jar %*改为call %java_exe% -jar quot;%PROGUARD_HOME%quot;\lib\proguard.jar %1 %2 %3 %4 %5 %6 %7 %8 %9http://hp.dewen.org/?p420http://hsx9566.iteye.com/blog/114200212.截屏连接真机在DDMS的Devices面板中点击照相机图标screen capturehttp://www.ruan8.com/tutorial_610.html