-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
应用 com.tencent.shadow.plugin 插件后,同步项目报错
AGP 版本:8.9.0
Gradle 版本:8.11.1
报错信息:
Caused by: java.util.NoSuchElementException: Collection contains no element matching the predicate.
经排查该报错 ShadowPlugin.kt#L225 发生于此处。
原因是资源处理路径变更:
旧路径:\build\intermediates\processed_res\pluginDebug\out\build\intermediates\processed_res\pluginDebug\out
新路径:\build\intermediates\linked_resources_binary_format\pluginDebug\processPluginDebugResources
临时解决方法:
val processedResFile = try {
File(
processResourcesTask.outputs.files.files.first { it.name.equals("out") },
"resources-$variantName.ap_"
)
} catch (ignored: Exception) {
File(
processResourcesTask.outputs.files.files.first { it.name.equals("process${capitalizeVariantName}Resources") },
"linked-resources-binary-format-$variantName.ap_"
)
}
Metadata
Metadata
Assignees
Labels
No labels