【问题标题】:Android Export signed application package errorAndroid导出签名的应用程序包错误
【发布时间】:2013-03-15 22:46:17
【问题描述】:

当我尝试为 google mao 导出签名的应用程序包时,我的 res/value/string.xml 文件出现此错误。我该怎么办?

app_name" is not translated in af, am, ar, be, bg, ca, cs, da, de, el, en-rGB, es, es-rUS, et, fa, fi, fr, hi, hr, hu, in, it, iw, ja, ko, lt, lv, ms, nb, nl, pl, pt, pt-rPT, ro, ru, sk, sl, sr, sv, sw, th, tl, tr, uk, vi, zh-rCN, zh-rTW, zu
Issue: Checks for incomplete translations where not all strings are translated
Id: MissingTranslation
If an application has more than one locale, then all the strings declared in one language should also be translated in all other languages.
If the string should not be translated, you can add the attribute translatable="false" on the <string> element, or you can define all your non-translatable strings in a resource file called donottranslate.xml. Or, you can ignore the issue with a tools:ignore="MissingTranslation" attribute.
By default this detector allows regions of a language to just provide a subset of the strings and fall back to the standard language strings. You can require all regions to provide a full translation by setting the environment variable ANDROID_LINT_COMPLETE_REGIONS.
You can tell lint (and other tools) which language is the default language in your res/values/ folder by specifying tools:locale="languageCode" for the root <resources> element in your resource file. (The tools prefix refers to the namespace declaration http://schemas.android.com/tools.)

【问题讨论】:

标签: android xml api export apk


【解决方案1】:

虽然所有其他答案都是正确的,但另一种选择是将tools:ignore="MissingTranslation" 属性添加到 xml 文件:

<?xml version="1.0" encoding="utf-8"?>
<resources
    xmlns:tools="http://schemas.android.com/tools"
    tools:ignore="MissingTranslation" >

    <!-- your strings here; no need now for the translatable attribute -->
</resources>

我更喜欢这个,因为 a) 它不需要更改 每个 字符串值,并且 b) 它不是应用程序设置,因此可以将其签入 git。另一方面,如果错误出现在您没有写入权限的引用项目中,则无济于事。

【讨论】:

    【解决方案2】:

    "Window" &gt; "Preferences" &gt; "Android" &gt; "Lint Error Checking":

    转到MissingTranslation 行,并将其设置为警告:

    【讨论】:

    • 这对我不起作用。我仍然收到错误
    【解决方案3】:

    只需将 string.xml 文件重命名为 donottranslate.xml。这可能会对您有所帮助。

    【讨论】:

      【解决方案4】:

      在 string.xml 文件中,只需将 translatable="false" 添加到字符串中。就这样

      <string name="app_name" translatable="false">Example App</string>
      

      【讨论】:

        【解决方案5】:

        试试这个

        转到 Eclipse -> 窗口选项卡 -> 首选项 -> Android -> Lint 错误检查 -> 取消选中完整的错误检查运行

        可能有帮助

        【讨论】:

          猜你喜欢
          • 2013-12-26
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2021-03-19
          • 1970-01-01
          • 1970-01-01
          • 2012-07-15
          相关资源
          最近更新 更多