java - 找不到与给定名称匹配的资源(在 'text' 处,值为 '@string/continue_label' )

标签 java android eclipse

首先让我说我是 Android 编程的新手。我正在使用 Pragmatic 的 Hello Android 书籍(第 3 版)。我正在处理流行的数独游戏示例,在从书中复制要放入 main.xml 文件中的代码后,出现以下错误:

error: Error: No resource found that matches the given name (at 'background' with value '@color/background')
.
error: Error: No resource found that matches the given name (at 'text' with value '@string/main_title').

error: Error: No resource found that matches the given name (at 'text' with value '@string/continue_label').

error: Error: No resource found that matches the given name (at 'text' with value '@string/new_game_label').

error: Error: No resource found that matches the given name (at 'text' with value '@string/about_label').

error: Error: No resource found that matches the given name (at 'text' with value '@string/exit_label').

他们可能都是相关的,但经过一番搜索,我不知道是什么问题。有什么建议吗?

最佳答案

错误说明了一切。你有一个 res 文件夹,你的资源如字符串/图像/布局可以驻留。所以你正在引用资源但它们不存在。就像你正在引用 about_label 字符串但在你的字符串 xml 中没有字符串 about_label 的标记及其值。请参阅 res->strings。检查所有 xml 文件并将您尝试使用的资源放入程序中

关于java - 找不到与给定名称匹配的资源(在 'text' 处,值为 '@string/continue_label' ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6793193/

相关文章:

java - Dagger2 无法生成组件类

android - ListViewDraggingAnimation 在 Android 5 Lollipop 上损坏

java - 如何在 Ant 中将 java 项目转换为插件项目?

eclipse - "Post-commit hook failed (exit code 1) with no output"- 这是什么意思?怎么修?

java - 将文件中的文本读取到 JTextField 数组中

javascript - Alfresco - 在网页脚本中获取许可证详细信息

Android 链接 .so 用于命令行可执行文件?

java - 调用 httpconnect 时编码不起作用

java - 添加自定义尺寸的 JTable

java - JUnit TestClass 无法识别类