Build error while building signed APK with Android Studio

When I try to build my project this error occured:

    Error: "mail_subtitle" is translated here but not found in default locale [ExtraTranslation]
    Error: "login_subtitle" is translated here but not found in default locale [ExtraTranslation]
    Error: "password_subtitle" is translated here but not found in default locale [ExtraTranslation]
            ~~~~~~~~~~~~~~~~~~~~~
    /xxxxxx/src/main/res/values-es/strings.xml:336: Also translated here
   Explanation for issues of type "ExtraTranslation":
   If a string appears in a specific language translation file, but there is
   no corresponding string in the default locale, then this string is probably
   unused. (It technically possible that your application is only intended
   to run in a specific locale, but it still a good idea to provide a
   fallback.).
   Note that these strings can lead to crashes if the string is looked up on
   any locale not providing a translation, so it important to clean them
   up.

  > 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
      }
  }
  ...

      

Ok, I know the error is because I have strings translated (into Spanish and Portuguese), but I don't have a default translation. The problem is that my default translation is inside my library and not in this project.

The structure of the whole project SHOULD BE as described: the default translation inside the library and the translations inside that other project. All the classes that use these strings are inside the library, and the translations are inside the project that uses the library because I need a different translation for every project I create.

Android Studio offers lintOptions "abortOnError false" but I don't want to use this flag, I want to be advised when I create an error, I just don't want to see this specific error.

+3


source to share


1 answer


try adding strings.xml file to defaults folder like /src/main/res/values/strings.xml?



and then add 3 unused lines in default language.

+1


source







All Articles