Android resource property must be defined in localized folders on specific FireOS devices

53 Views Asked by At

Within my resources (res/) folder, I have the following files among others.

├── values
│   ├── dimens.xml
│   ├── strings.xml
│   └── values.xml
├── values-en
│   └── strings.xml
├── values-de
│   └── strings.xml

In values/values.xml I define a boolean which is needed in my application:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <bool name="myboolean">false</bool>
</resources>

When I run my application on a device where the language is set to English however I find that an exception is thrown at runtime while referencing myboolean:

android.content.res.Resources$NotFoundException: Resource ID #0x7f020001 type #0x3 is not valid.

Strangely, if I copy the values.xml file into the localized folders, the boolean is read just fine and there is no runtime exception. I.e.:

├── values
│   ├── dimens.xml
│   ├── strings.xml
│   └── values.xml
├── values-en
│   ├── strings.xml
│   └── values.xml
├── values-de
│   ├── strings.xml
│   └── values.xml

Why does this value need to be defined in the localized folders? Shouldn't the default values folder suffice?

Of note, this only appears to happen to my application on specific FireOS devices and may be a bug specific the FireOS build on those devices. The FireOS build is based on Android API level 23.

0

There are 0 best solutions below