Magic behind R.java file(R.java 文件背后的魔法)
问题描述
最近我在使用 R.java 文件时遇到了一些问题.现在我决定做一个备份并删除文件,看看会发生什么.
Recently I have been having quite some problems with R.java file. Now I have decided to do a backup and delete the file to see what happens.
什么都没有发生,所以我创建了一个空的 R.java 文件并希望一切顺利.现在 Eclipse 似乎发现文件被篡改了,甚至发出警告:
Nothing happened, so I created an empty R.java file and hoped for the best. Now Eclipse seems to figure out that the file was tampered with and even issues a warning:
R.java was modified manually! Reverting to generated version!
仅此而已.我尝试手动构建它,但没有得到任何结果.
And that's all there is. I tried building it manually but got no results.
所以,我有两个问题:
- 我应该怎么做才能强制 Eclipse 重新生成文件
- 这里发生了什么?文件是如何创建的,生成文件的代码在哪里?
如果有任何帮助,我将不胜感激.像往常一样,问题发生在截止日期前几天:)
I would appreciate any help. As usual the problem occurred just a few days before the deadline :)
推荐答案
我发现了问题 - 我创建了一个 9patch 图像,其中补丁区域仅在 Y 轴上定义(我试图防止在另一个上调整大小).
I found the problem - I have created a 9patch image with the patch area defined only on the Y axis (I was trying to prevent resizing on the other one).
问题仍然存在:为什么没有关于错误的警告?或者如果有 - 它被埋在哪里?
The question remains: Why isn't there a warning about the error? Or if there is - where is it buried?
这篇关于R.java 文件背后的魔法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:R.java 文件背后的魔法


基础教程推荐
- 无法使用修饰符“public final"访问 java.util.Ha 2022-01-01
- “未找到匹配项"使用 matcher 的 group 方法时 2022-01-01
- 降序排序:Java Map 2022-01-01
- 减少 JVM 暂停时间 >1 秒使用 UseConcMarkSweepGC 2022-01-01
- 在 Libgdx 中处理屏幕的正确方法 2022-01-01
- Java Keytool 导入证书后出错,"keytool error: java.io.FileNotFoundException &拒绝访问" 2022-01-01
- FirebaseListAdapter 不推送聊天应用程序的单个项目 - Firebase-Ui 3.1 2022-01-01
- Java:带有char数组的println给出乱码 2022-01-01
- 设置 bean 时出现 Nullpointerexception 2022-01-01
- 如何使用 Java 创建 X509 证书? 2022-01-01