簡體   English   中英

使用Android Studio生成簽名APK時構建失敗

[英]Build failed when generate signed APK with Android Studio

當我嘗試構建我的項目時,發生了以下錯誤:

    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's technically possible that your application is only intended
   to run in a specific locale, but it's 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's 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
      }
  }
  ...

好的,我知道錯誤是因為我已經翻譯了字符串(西班牙語和葡萄牙語),但我沒有默認翻譯。 問題是我的默認翻譯是在我的庫中,而不是在這個項目中。

整個項目的結構需要如下所述:庫內的默認翻譯和其他項目內的翻譯。 所有使用這些字符串的類都在庫中,並且翻譯在使用該庫的項目中,因為我需要為我正在構建的每個項目進行不同的翻譯。

Android Studio提示lintOptions“abortOnError false”但我不想使用這個標志,我想建議當我發生構建錯誤時,我只是不想看到這個特定的錯誤。

嘗試在/src/main/res/values/strings.xml等默認值文件夾中添加strings.xml?

然后以默認語言添加3個缺少的字符串。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM