• 11

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191


File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

Eclipse “invalid resource directory name”

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.

  • 51
Reply Report
    • @ajbraus: Without knowing more details: You could try closing your IDE, rename the folder in the stored folder data structure and then restart Android Studio/Eclipse. It should then sync and show the correct new name.
    • On a side note, this is also true of files. I had a build blocked simply because a file made its way to that res folder... Removing it solved the issue for me

Just learned something!

FYI I 'm trying to store some audio files, created the folder audio under \res and got the same error. Then after some reading somebody wrote somewhere that \assets folder is a good folder for data files that don't change. So I placed my audio under \assets.

  • 6
Reply Report
      • 1
    • Don't drag your folder from 'res' to 'assets'. Delete your folder under 'res' and re-create it under 'assets'.

in bin/res/ you have a folder with the name of crunch delete that folder and the problem will be fixed I don't have idea why, but when you create a project in aide the aide dont create the crunch folder

  • 4
Reply Report

For putting your resources like .mp3 files, create a folder named /raw under /res folder and store your files in it.And of course clean your project after this.

This will definitely solve your problem.

  • 0
Reply Report