解决Error:(3) Error: "app_name" is not translated in "zh" (Chinese) [MissingTranslation]

最近把Android studio 升级到3.0,说实话不是特别需要我一般不会更新开发工具,3.0初次使用给我的感觉是界面更好看了,没那么卡了,有些代码提示更人性化了,今天来打了一个签名包,发现帅不过3天又掉坑了,报了一大堆错,如下:

Information:Gradle tasks [:TestDemo:assembleRelease]
D:\TestDemoTestDemo\src\main\res\values\strings.xml
Error:(3) Error: "app_name" is not translated in "zh" (Chinese) [MissingTranslation]
Error:(4) Error: "rationale_external_storage" is not translated in "zh" (Chinese) [MissingTranslation]
Error:(5) Error: "rationale_ask_again" is not translated in "zh" (Chinese) [MissingTranslation]
Error:(6) Error: "test_server_ws" is not translated in "zh" (Chinese) [MissingTranslation]
Error:(7) Error: "formal_server_ws" is not translated in "zh" (Chinese) [MissingTranslation]
Error:(9) Error: "wx_share_success" is not translated in "zh" (Chinese) [MissingTranslation]
Error:(10) Error: "wx_share_fail" is not translated in "zh" (Chinese) [MissingTranslation]
Error:(11) Error: "wx_share_cancle" is not translated in "zh" (Chinese) [MissingTranslation]
Error:(13) Error: "request_coin_failed" is not translated in "zh" (Chinese) [MissingTranslation]
Error:(14) Error: "requesting_order_number" is not translated in "zh" (Chinese) [MissingTranslation]
Error:(15) Error: "request_order_number_fail" is not translated in "zh" (Chinese) [MissingTranslation]
Error:(17) Error: "wechat_pay_success" is not translated in "zh" (Chinese) [MissingTranslation]
Error:(18) Error: "wechat_pay_fail" is not translated in "zh" (Chinese) [MissingTranslation]
Error:(19) Error: "wechat_pay_cancle" is not translated in "zh" (Chinese) [MissingTranslation]
Error:(23) Error: "qq_share_fail_file_is_wrong" is not translated in "zh" (Chinese) [MissingTranslation]
Error:(24) Error: "qq_share_fail_no_qq" is not translated in "zh" (Chinese) [MissingTranslation]
Error:(25) Error: "qq_share_fail_return_activity_null" is not translated in "zh" (Chinese) [MissingTranslation]
Error:(26) Error: "qq_share_fail_no_sdcard" is not translated in "zh" (Chinese) [MissingTranslation]
Error:(27) Error: "share_failed" is not translated in "zh" (Chinese) [MissingTranslation]
Error:(29) Error: "share_no_network" is not translated in "zh" (Chinese) [MissingTranslation]
Error:(30) Error: "no_wechat" is not translated in "zh" (Chinese) [MissingTranslation]
Error:(31) Error: "wechat_not_support_friend" is not translated in "zh" (Chinese) [MissingTranslation]
Error:(32) Error: "sina_weibo" is not translated in "zh" (Chinese) [MissingTranslation]
Error:(33) Error: "qq_zone" is not translated in "zh" (Chinese) [MissingTranslation]
Error:(34) Error: "qq" is not translated in "zh" (Chinese) [MissingTranslation]
Error:(35) Error: "wechat" is not translated in "zh" (Chinese) [MissingTranslation]
Error:(36) Error: "wechat_friend" is not translated in "zh" (Chinese) [MissingTranslation]
Error:(37) Error: "local_song_no_share" is not translated in "zh" (Chinese) [MissingTranslation]
Error:(38) Error: "message_bug_share_failed" is not translated in "zh" (Chinese) [MissingTranslation]
Error:(39) Error: "copy_link_success" is not translated in "zh" (Chinese) [MissingTranslation]
Error:Execution failed for task ':grab_toy: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
      }
  }
  ...
Information:BUILD FAILED in 5s
Information:31 errors
Information:0 warnings
Information:See complete output in console


一看描述,大概就是说String.xml 文件中有中文没有翻译神马的,难道还要翻译成英语惊讶

以前反正我是从未遇到过这个问题,我猜测的话应该是3.0对项目文件结构的要求更加严谨了,应该是要把中文的放在zh简写目录的,不过我没打算那么干,

就不尝试了,然后去stackoverflow上找到了解决方法,如下:

// 这个是解决lint报错的代码
lintOptions {
    abortOnError false
    disable 'MissingTranslation'
}

在主工程中加上这个报错不需要提示配置,然后就又可以愉快玩耍了大笑











评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值