I had such a problem according to analyst reports. The same problem - there is no Huawei device.
This happened in this list of devices: - Huawei G700-U10 Ascend G700 - Huawei G700-U20 Ascend G700 - Huawei G610-U20 Ascend
Stacktrace:
android.content.res.Resources$NotFoundException: Plural resource ID
I looked at the Resources class to clarify the problem and find any WORKAROUND.
public CharSequence getQuantityText(@PluralsRes int id, int quantity) throws NotFoundException { NativePluralRules rule = getPluralRule(); CharSequence res = mAssets.getResourceBagText(id, attrForQuantityCode(rule.quantityForInt(quantity))); if (res != null) { return res; } res = mAssets.getResourceBagText(id, ID_OTHER); if (res != null) { return res; } throw new NotFoundException("Plural resource ID #0x" + Integer.toHexString(id) + " quantity=" + quantity + " item=" + stringForQuantityCode(rule.quantityForInt(quantity))); }
According to this code, if a plural rule is not found for a given value, a plural will be indicated with the rule "OTHER" (before we get the Exception). I added a "different" element (rule) to the plural definition in the strings.xml file. The application was updated, and since then I have not received any report from this list of devices with this exception.
In my case, it was in Russian:
<plurals name="career_tournament_goal_wins_left"> <item quantity="one"> %1$s </item> <item quantity="few"> %1$s </item> <item quantity="many"> %1$s </item> <item quantity="other"> %1$s </item> </plurals>
This is not a panacea, but it works at least as a WORKAROUND.
Happy coding ...
source share