Android的R.java问题。 R.java文件不更新?文件、问题、Android、java

2023-09-05 11:21:25 作者:倾此一生只为伊人

我有同根/ r.java文件有问题。当我创建或如布局/values​​/strings.xml等资源编辑文件的r.java文件不更新。我按照教程,它由于某种原因,将不会更新。有在XML文件中没有错误。

I am having a problem with the gen/r.java file. When I create or edit files in resources such as layout /values/strings.xml e.t.c the r.java file does not update. I have followed a tutorial and it for some reason won't update. There are no errors in the xml file.

我听到有人说使用清洁/建设等,但这个只是删除了r.java文件,我不能多次尝试后,把它找回来。这使得我不得不再次重做整个项目只是为了让根文件备份。为什么会出现这种情况?

I have heard people say "use clean/build" e.t.c but this just removes the r.java file and I am unable to get it back after many attempts. This results in me having to redo the whole project again just to get the gen file back. Why is this happening?

推荐答案

我以前碰到这个问题,我解决,我们发现的是,该R.java编辑到Mainfest.xml文件后,文件只被生成。所以,只是做一个快速更改该文件。

I ran into this before, I work around we discovered was that the R.java file only gets generated after an edit to the Mainfest.xml file. So just make a quick change to that file.