用eclipse开发android应用的过程中,有时候需要用Logcat来对程序进行调试观察程序运行过程。一段时间之后,我们可能会突然看到Logcat报错:Could not create the view: For input string: "";再也使用不了logcat调试程序了。然而换个新的工作空间后发现logcat可以正常显示了,这是什么原因呢?我们仔细查看工作空间中的setting文件夹中的配置,终于发现了问题所在:
出此错的原因是Logcat视图中的filter包含了“:”;
解决方法是:更改eclipse的工作空间(workspace)中的文件“.metadata/.plugins/org.eclipse.core.runtime/.settings/com.android.ide.eclipse.ddms.prefs”。
将com.android.ide.eclipse.ddms.logcat.filters值设为空就可以了。