Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not get unknown property 'assembleRelease' for project

After updating Android Studio to version 2.2 and the gradle plugin to 2.2.0, I get following error:

Error:(32, 1) A problem occurred evaluating project ':jobdispatcher'. Could not get unknown property 'assembleRelease' for project ':jobdispatcher' of type org.gradle.api.Project.

The problem is in the build.gradle file of an imported jobdispatcher module:

task aar(dependsOn: assembleRelease)

What changes can I make to fix this?

Note, this issue is very similar to, but still a bit different to, that reported here.

like image 923
drmrbrewer Avatar asked Sep 20 '16 19:09

drmrbrewer


2 Answers

Move your dependency dependsOn inside your gradle task like shown below:

task aar() << {
    dependsOn 'assembleRelease'
}
like image 57
Volodymyr Avatar answered Oct 18 '22 07:10

Volodymyr


Just add "" like this to fix your problem:

from:

task aar(dependsOn: assembleRelease)

to:

task aar(dependsOn: "assembleRelease")
like image 42
lopez.mikhael Avatar answered Oct 18 '22 05:10

lopez.mikhael