Eclipse's Organize Imports tool can sometimes lead to hard-to-find problems.(First of all ,of course ,you should make sure your xml files have no errors.
)
For example,if your project doesn't have
R.java generated (which might happen because there's and earlier problem with one of the XML resources ),then Organize Imports will import the
android.R class.This other R class is part of the Android framework and has the same name as your local R class, making it hard to notice. So,if you have many compilation errors around you references to R resources
,check that android.R is not imported.
)
本文探讨了在使用Eclipse时,OrganizeImports工具可能导致的难以发现的问题,特别是当项目中缺少R.java文件时,可能会导入错误的android.R类,导致编译错误。文章提供了检查和解决此类问题的方法。

被折叠的 条评论
为什么被折叠?



