Attribute package of manifest tag and R class problem
com.XXX.XXX is defined in androidManifest like this , package="com.XXX.XXX" . There are a few other packages in the project which are not defined in the manifest.
Except for the package defined in the manifest ( package="com.XXX.XXX" ) all other packages where resource are used have an error - R cannot be resolved to a variable.
I have checked and verified the following -
- No java file has the import android.R or import com.XXX.XXX.R statements.
- Deleted the R.java file under gen and regenerated it.
- Refreshed the project and did a clean build.
- Checked the layout .xml files for any errors , the console does not show any开发者_如何转开发.
The project was working fine , I am not sure but I guess this error came after executing layoutopt.bat under the tools directory.
Is there anything else that I can check to resolve this error.
Thanks, Salil.
Do a project-clean from the Project menu in Eclipse. And in any file that has errors do ctrl+o to fix the imports.
You can access your application's resources from another package via com.XXX.XXX.R.[...]
精彩评论