使得通过Eclipse教程定制的Andr​​oid键盘;关于R引用错误不会消失 [英] Making custom Android keyboard via Eclipse tutorial; errors about R references won't go away

查看:159
本文介绍了使得通过Eclipse教程定制的Andr​​oid键盘;关于R引用错误不会消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想我不能跟随的这些说明(但我以前从未使用过Eclipse)。

I guess I can't follow these instructions (but I've never used Eclipse before).

下面是我的Eclipse露娜(2; 4.4.2)的项目结构,包括一看文件,用两个错误(<$ C $( SimpleIME.java ) C> R 1不能被解析到一个变量)(我已清理项目;改建为自动):

Here's my Eclipse Luna (2; 4.4.2) project structure, including a look at the file (SimpleIME.java) with the two errors (R cannot be resolved to a variable) (I have cleaned the project; rebuilding is automatic.):

有两个相同的的Andr​​oidManifest.xml 文件。一,我创建一个Eclipse的(或其他)创建的。

There are two identical AndroidManifest.xml files. One that I created and one that Eclipse (or whatever) created.

该项目设计没有活性但是Eclipse创建了一个无论如何,所以我删除了(与preVIEW;只有一个参考(自己)被发现)。

The project has no Activity by design but Eclipse created one anyway, so I deleted it (with preview; only one reference (itself) was found).

下面的 R.layout.keyboard

下面的 R.xml.qwerty

所以... 我应该怎么办?我剪切和粘贴文件的全部内容,甚至文件名,所以错别字不应该是罪魁祸首,但也许结构被搞砸。有没有在这否则优秀教程(第一个链接)中所示的结构。

So... what should I do? I cut and pasted entire contents of files and even file names, so typos shouldn't be the culprit, but maybe the structure is messed up. There's no structure shown at this otherwise excellent tutorial (first link).

推荐答案

通常Eclipse和也的Andr​​oid Studio有问题要解决的研究的资源,如果有什么地方例外。

Normally Eclipse and also Android Studio has problems to resolve the R resources if there is somewhere an exception.

保存所有类和尝试清理和重新构建。通常它应该给你一个例外,它的资源是错误的。 (使用错误的名字,形象,任何例外.xml文件的大写名称的任何图像。)

Save all your classes and try to clean and build again. Normally it should give you an exception which resource is wrong. (Any image with wrong name, upper case name of image, any .xml file with exceptions.)

的原因是Android的工具只能编译和创建研究文件,如果它是能够解决所有的资源,他们的标识符。

The cause is that the Android tools can only compile and create the R file if it is able to resolve all resources, and their identifiers.

如果你尝试干净的构建。请后,将出现错误。 (我做了Eclipse有一些问题,以显示对特定资源文件中的错误标记的经验)

If you tried clean and build. please post the error which will occur. (I made the experience that Eclipse has some issues to show the error marker on the specific resource file)

在一个侧面说明:为什么你还在使用Eclipse

On a side note: Why do you still use Eclipse?

这篇关于使得通过Eclipse教程定制的Andr​​oid键盘;关于R引用错误不会消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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