Could not get unknown property 'assembleRelease' for project
I tried all the previous answers, all are not working. Here is the one working after gradle 2.2. Starting from 2.2, those tasks also include "assembleDebug" and "assembleRelease". To access such tasks, the user will need to use an afterEvaluate closure:
afterEvaluate {
task aar(dependsOn: assembleRelease) {
//task
}
}
Just add "" like this to fix your problem:
from:
task aar(dependsOn: assembleRelease)
to:
task aar(dependsOn: "assembleRelease")
Move your dependency dependsOn
inside your gradle task like shown below:
task aar() << {
dependsOn 'assembleRelease'
}