as打包报 MissingTranslation 的解决办法

来源:互联网 发布:arcgis js query post 编辑:程序博客网 时间:2024/06/07 22:49

Android studio打包生成android apk的时候遇到了编译问题,AS生成apk的时候自己走了translate in english的路线。

几个string.xml文件报错 string value is not translated in "zh"(Chinese)[MissingTranslation]。


通过查找解决方案,发现有三种方案可以解决:

1、 在string 里加attribute      translatable="false":

<string name="hello_world" translatable="false">你好</string>

2、直接设定 string.xml文件内的resources的attribute:

<resources
   xmlns:tools="http://schemas.android.com/tools"
   tools:ignore="MissingTranslation">
    <string name="hello_world">你好</string>
</resources>

3、 File–>Setting–>Editor下的Inspections–>Android Lint 下的 Incomplete translation勾选去掉(不是很推荐,这是在google上找到的一种方法,试了一下不可以)




阅读全文
0 0
原创粉丝点击