MissingTranslation issue for release builds

Using the default Lint configuration, while building the release version of our application, we could face the MissingTranslation error:

Error:(3) Error: "pick_color_array" is not translated in "ru" (Russian) [MissingTranslation]
    <string-array name="pick_color_array">


1 errors, 0 warnings
Error:Execution failed for task ':android-rgb-tool:lintVitalRelease'.
> Lint found fatal errors while assembling a release target.

This happens when more than one locale is supported by an application but not all the string resources have been translated in all the languages.

Please notice that we don’t get this issue while building for debug (again, using the default Lint settings): in fact, checking the list of tasks executed for release builds, we can see there’s an additional lintVitalRelease run by Gradle. Checking its description, we understand that this task runs Lint on just the fatal issues in the Release build.

So, how to deal with it? Well, the first obvious thing to do is to provide a translation for all the strings for which is missing. But what if we don’t need or want to do that? In the end, we know the system will rely on the default language if a translation is not provided for a specific locale or in some cases there is no translation at all for our string resources.

Quick and dirty

The quickest thing to do is to turn off this check from the module gradle build script:

android {
    lintOptions {
        checkReleaseBuilds false

It works, indeed, but in this way we are turning off all the checks for a release build, not only the one related to a missing translation. Thus, this kind of “solution” should be avoided at all costs.

Quick and dirty, again

The second option we have is to configure the Lint options to not abort the build process if an error is found:

android {
    lintOptions {
        abortOnError false

In this case, checks are run but the build is performed even when errors are found. That’s slightly better than the previous solution but again it should be avoided: in the end, the APK is produced, so we should manually check the build logs or the Lint report to see if critical errors have been raised during the process.

Ignoring MissingTranslation issue only

Both previous solutions are not the proper ways to deal with missing translations because those settings are valid in general at application level and not for our specific problem.

If we want to ignore the issue only, maybe because we are fine to rely on the default language string resources, we can simply add the following attribute:


This attribute must be set for the specific string for which we’re fine to ignore the issue:

<string name="example" tools:ignore="MissingTranslation">Lorem ipsum dolor sit amet&#8230;</string>

Please notice that we are telling to ignore the issue: again, we must be really sure about what we’re doing, because if we’ll add later a new language, we won’t get any failure for those strings for which the missing translation error must be ignored.

Set strings as NON-translatable

Another option is to set the string as non-translatable: we simply have to add the following attribute for all the strings for which we don’t want to provide a translation in all the supported languages (we have to set this in the default string resource files, usually located in res/values/).

<string name="example" translatable="false">Lorem ipsum dolor sit amet&#8230;</string>

The final results is the same as the previous solution, but I think this is better, because instead of asking to ignore something, we’re explicitly telling that some resources are not translatable.

Define NON-translatable strings in a dedicated file

The last two ways to deal with the MissingTranslation issue work fine, but the problem arises if our application has a lot of strings that should not be translated: the extra attributes will become a bit noisy and we could forget to set it for newly defined strings.

In such a situation, the way to go is to define these strings in a dedicated file called donottranslate.xml: Lint will consider all these resources as not-translatable.

As we’ve seen, there are few ways to deal with missing translations, even if I would suggest the following pattern:

  1. if non-translatable strings are just few, set the translatable="false" for them.
  2. if non-translatable strings are a considerable % of the total, use the donottranslate.xml file.

Official documentation is available here.

3 thoughts on “MissingTranslation issue for release builds”

    1. I’ve never tried that particular Cordova plugin, but lintOptions configuration is available as part of the Android Gradle plugin. If you’re using the Crosswalk plugin, I’d anyway configure Lint in the gradle script of your Android application.

Leave a Reply

Your email address will not be published. Required fields are marked *