Eclipse“无效资源目录名称” [英] Eclipse "invalid resource directory name"
问题描述
每当我尝试在Eclipse(3.7.0)中为我的Android项目添加资源文件夹时, ,我总是收到以下错误:
无效资源目录名称:C:\path_to_project\res / new_folder_name
您会注意到,新创建的文件夹的斜杠错误,所以我猜这是某些Windows特定的问题,虽然我无法为我的生活找出如何解决它。
以下是我尝试创建文件夹的一些方法:
- 右键单击Eclipse中项目中的res - >新建 - >文件夹
- 通过Windows资源管理器创建新文件夹并将其导入Eclipse项目
- 完全从我的工作空间中删除项目,在资源管理器中创建该文件夹,并将整个项目重新导入到Eclipse
-
- 使用Cyg的命令行执行相同操作win和DOS
在所有这些情况下,我最终都以错误的方式进行了斜杠。
我缺少什么?
res-Folder中的文件夹只能被允许为由Android定义,例如drawable。请参阅 http://developer.android.com/guide/topics/resources/ available-resources.html 获取更多信息。如果您选择其他任何内容,则在构建项目时会收到错误无效的资源目录名称。
I've been stuck on this for the past several days.
Whenever I try to add a resource folder to my Android project in Eclipse (3.7.0), I always get the following error:
invalid resource directory name: C:\path_to_project\res/new_folder_name
You'll notice that the slash goes the wrong way for the newly created folder, so I'm guessing this is some sort of Windows-specific issue, though I can't for the life of me figure out how to resolve it.
Here's some of the ways I tried creating the folder:
- Right click on "res" in project in Eclipse -> New -> Folder
- Create the new folder through Windows Explorer and import it into the Eclipse project
- Remove the project from my workspace entirely, create the folder in Explorer, and re-import the entire project into Eclipse
- Do the same using the command line, both Cygwin and DOS
In all of these cases, I end up with the slash going the wrong way.
What am I missing?
Folders in the res-Folder are only allowed to be those defined by Android, for example "drawable". See http://developer.android.com/guide/topics/resources/available-resources.html for more information. If you choose anything else you get the error "invalid resource directory name" when building your project.
这篇关于Eclipse“无效资源目录名称”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!