findAabConstraintReferencedIds = true时报错 “AabResGuard plugin required”
adolfodoriano opened this issue · 3 comments
adolfodoriano commented
AadResGuard 已经配置,可以正常运行
findAabConstraintReferencedIds = false 时,XmlClassGuard也能正常运行。
把findAabConstraintReferencedIds 设置成true后,同步时报错 "AabResGuard plugin required"。
XmlClassGuardPlugin.kt
private fun Project.createAabFindConstraintReferencedIdsTask(variantName: String) {
val aabResGuardTaskName = "aabresguard$variantName"
val aabResGuardTask = project.tasks.findByName(aabResGuardTaskName)
?: throw GradleException("AabResGuard plugin required")
val taskName = "aabFindConstraintReferencedIds$variantName"
val task =
createTask(taskName, FindConstraintReferencedIdsTask::class, aabResGuard, variantName)
aabResGuardTask.dependsOn(task)
}
源码中是找不到 aabResGuardTaskName 任务会抛出这个错误。
Gradle任务列表中,确实是没有找到以"aabresguard"开头的任务名称。请问我是哪里操作有误吗?
liujingxing commented
该任务依赖aabresguard插件
adolfodoriano commented
有引用插件。
发现问题出在这里:build.gradle中这两个插件的引用顺序我弄反了。
apply plugin: "com.bytedance.android.aabResGuard"
apply plugin: "xml-class-guard"
missingcall commented
牛逼,解决了