RuAware
RuAware

Reputation: 969

Gradle task failing from Android Studio, Wrapper working fine

I have a project with multiple modules and have add the following task, I have made it simple here but it does more.

When I run using ./gradlew modulename:assemblePush from the terminal it works fine.

However when I locate the task from the gradle pane (module -> tasks -> Other -> assemblePush) in Android Studio the build script fails with:

What went wrong:

Could not determine the dependencies of task ':assemblePush'. Task with path 'assembleRelease' not found in root project 'moudleName'.**

allprojects {
    task assemblePush(dependsOn: ['assembleRelease']) {
        doLast {
       println name
       println project.name
       }
   }
}

Upvotes: 1

Views: 227

Answers (1)

RuAware
RuAware

Reputation: 969

Moving to sub projects has worked, this can now be called by Android Studio

subprojects {
    task assemblePush(dependsOn: ['assembleRelease']) {
        doLast {
       println name
       println project.name
       }
   }
}

Upvotes: 1

Related Questions