Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Background

I've recently migrated my app to Android-Studio. I had some issues doing so, but I got over them eventually.

The problem

For some reason, on Android Studio, when I try to sign an APK, I get a lot of errors that look like this:

Error:(16) Error: "..." is not translated in "de" (German), "el" (Greek), "iw" (Hebrew) [MissingTranslation] 

(where "..." is a string)

At the bottom, after a lot of errors of this kind, I see this:

Error:Execution failed for task ':app:lintVitalRelease'. > Lint found fatal errors while assembling a release target. To proceed, either fix the issues identified by lint, or modify your build script as follows: ... 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     } } ... 

The question

I'm not sure what's wrong and how I can fix it. On Eclipse I did it very easily. Missing translations shouldn't stop me from signing an APK...

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?

Can anyone please help me? 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?

like image 949
android developer Avatar asked Dec 14 '14 18:12

android developer


People also ask

How to open string Editor in Android Studio?

Click File > Settings (on macOS, Android Studio > Preferences) to open the Settings dialog.

Can I import APK to Android studio?

Or, if you already have a project open, click File > Profile or Debug APK from the menu bar. In the next dialog window, select the APK you want to import into Android Studio and click OK. Android Studio then displays the unpacked APK files, similar to figure 1.

What is Translation Editor Android Studio?

The Translations Editor provides a consolidated and editable view of all of your default and translated string resources. For an introduction to translating your app for different languages, read Supporting different languages and cultures.


1 Answers

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'             }         }     } } 
like image 166
yvolk Avatar answered Sep 19 '22 20:09

yvolk