quangkid
quangkid

Reputation: 1418

Can't create layout folder in Android Studio by new Android Resource Directory (Error : enter or select a qualifier)

Step 1 : Right click on res folder, choose New > Android Resource Directory

Step 2 : Choose layout in resource type, then click OK

Result : Error in name : enter or select a qualifier

It's not happen with menu type. Do I missing something? I have to create directory instead

enter image description here

Upvotes: 12

Views: 9981

Answers (2)

Junia Montana
Junia Montana

Reputation: 623

It's an old question but whoever is having the same problem might find this helpful. Here's another way to create an android resource directory in the layout folder.

  • Right click res folder
  • Click new and the scroll all the way down to XML with the icon
  • Click that and leave everything as it is = Click finish.

Also, make sure to refactor and rename(whatever you like) the XML file that gets generated automatically after creating the resource folder.

screenshot

Upvotes: 12

Boban Talevski
Boban Talevski

Reputation: 153

Yeah, AS 3.0+ seems to do that to me as well.

But there really shouldn't be a difference between a new Android Resource Directory and just a new (regular) Directory if you don't actually use any qualifiers. It's still just a directory with a different name depending on the qualifier(s). So, you can safely choose new Directory and move along.

And for the sake of it, you can choose new Android Resource Directory with some random qualifier which will just add the qualifier to the directory name, and after it's created, refactor it by deleting the qualifier part from the directory name and you'll end up with a directory named "layout" which is an "Android Resource Directory".

Just do the refactoring with the Project view selected in the Project pane, not the Android view.

Upvotes: 4

Related Questions