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

2

12

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

Polybius answered 25/12, 2017 at 2:53 Comment(0)
F
12

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

Floreated answered 23/7, 2018 at 22:0 Comment(2)
Hi Junia. Thanks for your answer. This answer could be improved by attaching a single screenshot of Android Studio showing the 3 levels of cascading menus that are opened by this procedure.Jadotville
Hi Elletlar, I've updated the answer by adding the image. Thank you so much, I'm new here, so still learning how to post answers properly :))Floreated
A
4

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.

Authoritarian answered 6/1, 2018 at 22:47 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.