开发者

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 -

  1. No java file has the import android.R or import com.XXX.XXX.R statements.
  2. Deleted the R.java file under gen and regenerated it.
  3. Refreshed the project and did a clean build.
  4. 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.[...]

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜