Eclipse的"无效的资源目录名称和QUOT;名称、目录、资源、Eclipse

2023-09-05 08:21:31 作者:遇见你是最美丽的意外

我一直停留在这个过去好几天了。

I've been stuck on this for the past several days.

每当我试图将一个资源文件夹添加到我在Eclipse中的Andr​​oid项目(3.7.0),我总是得到以下错误:

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

您会注意到斜杠去了错误的方式为新创建的文件夹,所以我猜这是某种特定于Windows的问题,虽然我不能为我的生活弄清楚如何解决吧。

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:

右键点击资源项目在Eclipse - >新建 - >文件夹 在通过Windows资源管理器中创建新的文件夹并将其导入Eclipse项目 从我的工作空间中删除该项目完全,请在资源管理器中的文件夹,并重新导入整个项目到Eclipse 使用命令行做同样的,无论是Cygwin和DOS

在所有这些情况下,我最终斜线走错路。

In all of these cases, I end up with the slash going the wrong way.

我在想什么?

推荐答案

在RES-文件夹文件夹是只允许那些由Android的定义,例如绘制。请参阅http://developer.android.com/guide/topics/resources/available-resources.html了解更多信息。如果您选择任何其他建设项目,当你得到错误无效的资源目录名称。

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.

 
精彩推荐
图片推荐