'android gradle task dependency

I wasnt to execute some custom tassk whenever prodrelease is build. I added something like this in build.gradle

android {
           .
           .
           assembleProdRelease.dependsOn(<some..custom..task>)
    }

but it throws error

org.gradle.api.GradleScriptException: A problem occurred evaluating project ':app' Caused by: groovy.lang.MissingPropertyException: Could not get unknown property 'assembleProdRelease' for extension 'android' of type com.android.build.gradle.internal.dsl.BaseAppModuleExtension



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source