Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Override Task in build.gradle

How to override a task in build.gradle ?

I trying to compile the build.gradle with the dependency Dynatrace, a conflict between task names is occurring.

Error: Cannot add task ':app:autoInstrumentDebug' as a task with that name already exists.

I have checked my current tasks on build.gradle menu and don't have found any task with this path name.

like image 599
Gabriel Marcos Avatar asked Dec 24 '22 11:12

Gabriel Marcos


1 Answers

I believe you should try overwriting the task (make sure to test well the App afterwards to avoid unwanted side-effects).

In order to you should do the following:

task(overwrite: true){
apply plugin: 'com.name.of.your.plugin'
plugin {
    defaultConfig {

    }
}}

I hope this helps you buddy! I'm sure you're coworkers will be very proud of you!

like image 147
Augusto Knijnik Avatar answered Dec 27 '22 01:12

Augusto Knijnik