Issue
This is probably a very basic problem but I am very new to Android development and I can't find a a reason why this isn't working. I am just testing icons for different locales and I keep getting
/home/isaac/AndroidStudioProjects/MyFirstApp/app/src/main/res/mipmap-hdpi-en-rUS: Error: Invalid resource directory name
But as far as I can tell from this tutorial (see Table 2 "Language and region"), I seem to have it specified correctly, appending -en-rUS
to the folders with a different icon in them. It even looks right in Android Studio:
And also in the folder structure for my res
folder:
isaac@ib:~/AndroidStudioProjects/MyFirstApp/app/src/main/res$ tree
.
├── drawable
│ └── ic_launcher_background.xml
├── drawable-anydpi
├── drawable-v24
│ └── ic_launcher_foreground.xml
├── layout
│ ├── activity_display_message.xml
│ └── activity_main.xml
├── mipmap-anydpi-v26
│ ├── ic_launcher_round.xml
│ └── ic_launcher.xml
├── mipmap-anydpi-v26-en-rUS
│ ├── ic_launcher_round.xml
│ └── ic_launcher.xml
├── mipmap-hdpi
│ ├── ic_launcher_foreground.png
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
├── mipmap-hdpi-en-rUS
│ ├── ic_launcher_foreground.png
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
├── mipmap-mdpi
│ ├── ic_launcher_foreground.png
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
├── mipmap-mdpi-en-rUS
│ ├── ic_launcher_foreground.png
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
├── mipmap-xhdpi
│ ├── ic_launcher_foreground.png
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
├── mipmap-xhdpi-en-rUS
│ ├── ic_launcher_foreground.png
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
├── mipmap-xxhdpi
│ ├── ic_launcher_foreground.png
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
├── mipmap-xxhdpi-en-rUS
│ ├── ic_launcher_foreground.png
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
├── mipmap-xxxhdpi
│ ├── ic_launcher_foreground.png
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
├── mipmap-xxxhdpi-en-rUS
│ ├── ic_launcher_foreground.png
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
├── values
│ ├── colors.xml
│ ├── ic_launcher_background.xml
│ ├── strings.xml
│ └── styles.xml
└── values-land
└── colors.xml
Solution
mipmap-hdpi-en-rUS: This is invalid res directory.
mipmap-hdpi is valid.
we add qualifiers like locale qualifiers for values folders not mipmap folders.
Suppose we have string resources we want them to provide different for different locales so we use qualifiers.
Answered By - Relsell
Answer Checked By - Mary Flores (JavaFixing Volunteer)