为什么我的资源,在我的Andr​​oid项目突然没有得到解决?

问题描述:

Eclipse正在抱怨我的Andr​​oid项目说我所有的对资源的引用都没有得到解决,即使R.java确实存在。例如:

Eclipse is complaining about my Android project saying all my references to resources are unresolved, even though R.java does exist. For example:

signin_btn=(Button)findViewById(R.id.signin_btn); signin_btn.setOnClickListener(this);

我肯定有我的资源定义si​​gnin_btn。不知道为什么Eclipse的是没有看到我的R舱了。如何解决?

I definately have signin_btn defined in my resources. Dont know why Eclipse is not seeing my R class anymore. How to fix?

这发生在我身上,这就是我的想法发生了:

It happens to me, this is what I think happens:

无论过程产生R.java开始在你的资源的顶部和工程的底部。如果遇到错误的地方,它只是停止...什么资源都没有被添加到R.java了离开。这就是为什么有些人会说未解决,和其他人将被罚款。

Whatever process generates R.java starts at the top of your resources and works to the bottom. If it encounters an error somewhere, it just stops... leaving whatever resources haven't been added to R.java out. This is why some of them will say "unresolved", and others will be fine.

似乎每一次你在项目中保存文件时,它重新生成R.java(也许它只是文件中的RES /),所以你可能什么固定在发电机打破了,当你保存AndroidManifest.xml中,它再生R.java。

It seems that every time you save a file in your project, it regenerates R.java (maybe it's just the files in res/), so you probably fixed whatever the generator broke on, and when you saved AndroidManifest.xml, it regenerated R.java.