简体   繁体   English

R.layout.main错误,没有解决方案

[英]R.layout.main error, no solutions have worked

I am just beginning to develop for Android. 我刚刚开始为Android开发。 The tutorial book I am using uses the code below, but, put simply, it does not work. 我正在使用的教程使用以下代码,但简单地说,它不起作用。 As I've searched for an answer, I find that none of the solutions people say have rid them of this error have worked for me. 在寻找答案的过程中,我发现没有人说能解决他们的错误的解决方案对我有用。 Here is a list of methods that did not work. 这是无效的方法列表。

-Cleaning: It just said it couldn't clean until I resolved the error. -Cleaning:只是说在我解决错误之前无法清理。

-Building the Project: It built it, but the error did not go away. -生成项目:生成了项目,但是错误没有消失。

-Deleting import R: The error did not go away. -删除导入R:错误没有消失。

-Renaming import R to import me.package.R: The error persisted. -重命名import R以导入me.package.R:错误仍然存​​在。

Here is the code that is generating the error. 这是生成错误的代码。

public void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
}

Can anyone help me out? 谁能帮我吗?

您的项目可能需要引用一些库jar,由于某些编译问题,由于未正确生成项目的R.java。

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

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