How to sign APK on Android Studio even with non-translated strings? How to sign APK on Android Studio even with non-translated strings? android android

How to sign APK on Android Studio even with non-translated strings?


The cleanest way to solve the problem is to disable Lint checks of missing translations for release builds only.

To do so add "disable 'MissingTranslation'" to your build.gradle file as shown below:

android {    buildTypes {        release {            lintOptions {                disable 'MissingTranslation'            }        }    }}


To me it seems as if Lint is preventing the exporting of the APK, and that the reason is that I didn't translate all of the strings. Is that true?

Yes. Default option is lintOptions.abortOnError = true

Can anyone please help me?

You should open the build.gradle file located at the main project module, or the generic folder if you do not have a module. Then add the suggested lines:

android {    lintOptions {        checkReleaseBuilds false        // Or, if you prefer, you can continue to check for errors in release builds,        // but continue the build even when errors are found:        abortOnError false    }}

Some Lint warnings are by default turned to studio as errors, I don't actually know why, but in terms of translations I guess that is a way to "stop" you publishing an app that the translation is incomplete due to a last minute additions of some texts.

With the lintOptions checkReleaseBuilds abortOnError you set the checking of Lint not to run for release versions and also not stopping if an "error" is found. Below I explain where the Lint errors settings can be found, so if you want to go further you can go one step forward and read them one by one. Some of them provide helpful instructions for code optimizations.

How can I fix this, so that Lint will show me just warnings instead? or a confirmation dialog if I'm sure I want to do it?

There is also an option at the Android Studio settings to change any Lint error to Lint warning, but I never test that. I usually turn to the gradle solution.

The option is located at Settings > Inspections > Android Lint. For easy find open Settings and at the search (located at the top) type Lint translation there you can change the translation options appear at the left from errors to warnings.

An other option if your error strings never going to be translated is to add at your XML string files tools:ignore="MissingTranslation" either at the root item or at each non-translatable string.


Simple way to solve this Error

Just add following Code To do add "disable 'MissingTranslation'" to your build.gradle file as shown below:

...  android {      lintOptions {          checkReleaseBuilds false          // Or, if you prefer, you can continue to check for errors in release builds,          // but continue the build even when errors are found:          abortOnError false      }  }  ...

OR You can also Add this:

android {        buildTypes {            release {                lintOptions {                    disable 'MissingTranslation'                }            }        }    }