如何覆盖 build.gradle
中的任务?
我尝试使用依赖项 Dynatrace
编译 build.gradle
,任务名称之间发生冲突。
Error: Cannot add task ':app:autoInstrumentDebug' as a task with that name already exists.
我已在 build.gradle
菜单上检查了当前任务,但没有找到任何具有此路径名称的任务。
最佳答案
我相信您应该尝试覆盖该任务(确保之后对应用程序进行良好的测试,以避免不必要的副作用)。
为此,您应该执行以下操作:
task(overwrite: true){
apply plugin: 'com.name.of.your.plugin'
plugin {
defaultConfig {
}
}}
希望这对你有帮助, friend !我相信你的同事会为你感到骄傲!
关于java - 覆盖 build.gradle 中的任务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47888573/