为什么我的资源,在我的Andr​​oid项目突然没有得到解决? [英] Why are my resources suddenly unresolved in my Android project?

查看:135
本文介绍了为什么我的资源,在我的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.

这篇关于为什么我的资源,在我的Andr​​oid项目突然没有得到解决?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆