java android:res \ drawable-hdpi \ Restaurant-Blue-2-icon.png:文件名无效:必须只包含[a-z0-9_。],无法修复

时间:2012-06-10 17:05:37

标签: java android

我得到了:

[2012-06-10 12:47:39 - pet_game] Launch canceled!
[2012-06-10 12:49:13 - pet_game] res\drawable-hdpi\Restaurant-Blue-2-icon.png: Invalid file name: must contain only [a-z0-9_.]
[2012-06-10 12:49:13 - pet_game] res\drawable-hdpi\Restaurant-Blue-2-icon.png: Invalid file name: must contain only [a-z0-9_.]
[2012-06-10 12:49:13 - pet_game] res\drawable-hdpi\Restaurant-Blue-2-icon.png: Invalid file name: must contain only [a-z0-9_.]
[2012-06-10 12:49:13 - pet_game] res\drawable-hdpi\Restaurant-Blue-2-icon.png: Invalid file name: must contain only [a-z0-9_.]
[2012-06-10 12:49:13 - pet_game] res\drawable-hdpi\Restaurant-Blue-2-icon.png: Invalid file name: must contain only [a-z0-9_.]
[2012-06-10 12:49:13 - pet_game] res\drawable-hdpi\baseball-icon.png: Invalid file name: must contain only [a-z0-9_.]

我知道这是因为我在图像文件名中有大写字母,所以我删除了这两个文件。但是,我仍然得到同样的错误。我试图刷新整个项目并重新启动eclipse,但它没有帮助。我该怎么办?

3 个答案:

答案 0 :(得分:4)

请勿使用:-。而是使用:_

答案 1 :(得分:1)

资源名称不允许使用大写字母。只有小写字母(a-z),数字0-9,。(点)和_(下划线)有效 使用Restaurant_Blue_2_icon.pngbaseball_icon.png作为图片名称。

答案 2 :(得分:0)

baseball-icon.png名称太无效,请将其更改为baseball_icon.png,您就可以了。