Kotlin中的STRING_TOO_LARGE字符串 [英] STRING_TOO_LARGE String in Kotlin
问题描述
当我在项目中添加支持 Kotlin 的插件时,然后从项目的 string.xml 文件中读取大字符串.它在下面给了我以下错误.
When I added plugins to support the Kotlin in my project, Then after it read large string from my project's string.xml file. It gives me following error below.
错误:字符串太大,无法使用UTF-8编码,而是写为" STRING_TOO_LARGE ".
error: string too large to encode using UTF-8 written instead as 'STRING_TOO_LARGE'.
推荐答案
这是gradle插件的问题.
如果将插件升级到 3.3.0-alpha06
或更高版本,并将gradle升级到4.9
,则它应该可以工作.由于它是Alpha,因此并不理想,但它为我解决了这个问题.
If you upgrade the plugin to 3.3.0-alpha06
or later and upgrade gradle to 4.9
it should work. It's not ideal since it is alpha, but it fixed the issue for me.
将<?xml version="1.0" encoding="utf-8"?>
添加到任何缺少该资源的.xml文件的顶部.
Add <?xml version="1.0" encoding="utf-8"?>
to the top of any resource .xml file that is missing it.
这篇关于Kotlin中的STRING_TOO_LARGE字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!