为区域设置制作图标时无效的资源目录名称

时间:2018-04-01 16:38:39

标签: android

这可能是一个非常基本的问题,但我对Android开发很新,我找不到这个原因不起作用的原因。我只是测试不同语言环境的图标,我一直在

/home/isaac/AndroidStudioProjects/MyFirstApp/app/src/main/res/mipmap-hdpi-en-rUS: Error: Invalid resource directory name

但据我所知this tutorial(参见表2“语言和地区”),我似乎正确指定了它,将-en-rUS附加到文件夹中,其中包含不同的图标。它甚至在Android Studio中看起来正确:

enter image description here

还在我的res文件夹的文件夹结构中:

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

1 个答案:

答案 0 :(得分:1)

mipmap-hdpi-en-rUS:这是无效的res目录。

mipmap-hdpi有效。

我们为值文件夹而不是mipmap文件夹添加区域设置限定符等限定符。

假设我们有字符串资源,我们希望它们为不同的语言环境提供不同的字符串,因此我们使用限定符。

相关问题