自升级到Android Gradle Plugin 3.2后,将删除不带必需默认值的资源.导致构建失败.
Execution failed for task ':app:processDebugResources'.
> Android resource linking failed
warn: removing resource my.package.name:string/my_string_resource without required default value.
/path/to/layout.xml: AAPT: error: resource string/my_string_resource (aka my.package.name:string/my_string_resource) not found
Run Code Online (Sandbox Code Playgroud)
可以禁用吗?我目前正在使用最新的Android Gradle插件:3.3.0
我们需要这样做,因为我们客户的翻译流程要求我们使用除默认语言之外的其他语言提供应用程序的测试版本.必须省略默认值,以便翻译人员可以轻松查看仍需要翻译的内容.
我们使用 Apache POI 来操作 Microsoft Word 文档。
到目前为止,我们可以使用以下 API 访问文档中所有必需的段落(包括页眉、页脚、表格)XWPFDocument
val allBodyElements = bodyElements
.plus(headerList.flatMap { it.bodyElements })
.plus(footerList.flatMap { it.bodyElements })
val allParagraphs = allBodyElements.flatMap {
when (it) {
is XWPFParagraph -> listOf(it)
is XWPFTable -> it.rows
.flatMap { row -> row.tableCells }
.flatMap { cell -> cell.paragraphs }
else -> emptyList()
}
}
Run Code Online (Sandbox Code Playgroud)
不幸的是,这遗漏了文本框中包含的段落。查看底层word/document.xml
这些 TextBox 的嵌入方式如下:
<w:body>
<w:p>
<w:r>
<mc:AlternateContent>
<mc:Choice>
<w:drawing>
<wp:anchor>
<a:graphic>
<a:graphicData>
<wps:wsp>
<wps:txbx>
<w:txbxContent>
<!-- DESIRED PARAGRAPH -->
</w:txbxContent>
...
</mc:Choice> …
Run Code Online (Sandbox Code Playgroud) 我正在使用可放心的方式编写冒烟测试,并且想要遍历api以确保不会发生意外错误。
我有一个看起来像这样的数据结构:
{
...
"sites": [
{
...
"groups": [
{
...
"locations": [
{
...
"racks": [
{
"rackId": 123456789,
...
},
{
"rackId": 987654321,
...
},
...
]
}
]
}
]
},
{
...
"groups": [
{
...
"locations": [
{
...
"racks": [
{
"rackId": 11111111,
...
},
{
"rackId": 22222222,
...
},
...
]
}
]
}
]
},
...
]
}
Run Code Online (Sandbox Code Playgroud)
使用RestAssured中捆绑的JsonPath,我试图获取所有rackId的固定列表,然后为这些rackId调用后续请求。
jsonPath.getList("sites.groups.locations.racks.rackId", Long.class);
>> java.lang.NumberFormatException: For input string: "[[[406071537, 406071538, 406071539, 406071540, 406071541]]]" …
Run Code Online (Sandbox Code Playgroud)