首页 > 解决方案 > Lint 在组装发布目标时发现致命错误,添加语言 xml 文件

问题描述

我刚刚在我的 Android Studio 项目中为另一种语言添加了一个新的 xml 文件。构建项目时出现错误:

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

解决方案


我发现翻译人员输入了错误的资源名称。例如,它必须在哪里

<string name="Example">"This is an example"</string>

他打字

<string name="Exmple">"This is an example"</string>

因此,“示例”与“示例”不同。Android Studio 可以提供有关该错误的更多信息。我花了几个小时才知道。xml 文件有数百个字符串资源。像“资源示例未以默认语言定义”这样的错误行就足够了。


推荐阅读