简体   繁体   English

R.layout.main的原始类型int没有字段输出

[英]The primitive type int of R.layout.main does not have a field out

I am new to Android, When I run the app it throws the following: 我是Android的新手,在运行应用程序时会引发以下问题:

"The primitive type int of R.layout.main does not have a field out" “ R.layout.main的原始类型int没有字段输出”

What am I doing wrong? 我究竟做错了什么?

TIA Ricard TIA Ricard

1) The 'R' file is generated from the assets in the res folder. 1)从res文件夹中的资产生成“ R”文件。

2) Check the file /res/layout/main.xml. 2)检查文件/res/layout/main.xml。 The error message is stating there is not an 'out' field in this file. 错误消息指出此文件中没有'out'字段。 So your Java code must align with main.xml. 因此,您的Java代码必须与main.xml保持一致。

3) Check the 'R' file generated by the build process. 3)检查由构建过程生成的“ R”文件。 Verify there is a 'main' in the 'layout' class. 验证“布局”类中是否存在“主”。

Hints Eclipse does a good job of building the 'R' file. 提示Eclipse在构建“ R”文件方面做得很好。 If it does not match the 'res' folder rebuild the project. 如果与“ res”文件夹不匹配,则重建项目。

Do not edit the 'R' file by hand as it will be overwritten during the next build. 请勿手动编辑“ R”文件,因为在下一个构建中它将被覆盖。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM