I want to skip one of the tasks of Android gradle build, so I tried something like
project.tasks.getByName("transformNativeLibsWithStripDebugSymbolForDebug").onlyIf {
println("Skipping")
return false
}
apply plugin: 'com.android.library'
It's dynamically generated task. Try to add next:
android {...}
afterEvaluate { project ->
project.tasks.transformNativeLibsWithStripDebugSymbolForDebug {
onlyIf {
println 'Skipping...'
return false
}
}
}
dependencies {...}
In Gradle Console you should see:
Skipping...
:app:transformNativeLibsWithStripDebugSymbolForDebug SKIPPED
Do not forget that transformNativeLibsWithStripDebugSymbolForDebug task is only executed, when you use assembleDebug task (or Shift+F10 combination in Android Studio).