Despite being late in the answer, it is difficult for Google (single quotes), and it is not clear what is going on. I don't have a reputation yet to comment or request volume (or send 3 links), so this answer can be a bit tedious.
To answer quickly, you may have several Gradle plugins in your project.
Sync Gradle Wrapper and Plugins
My problem started with a damaged IML file. Android Studio (between closing and reopening the project) started complaining that IML was gone (it wasn’t), and the module should be removed, and I refused. It was saved, I upgraded to AS 0.8.7 (channel channel) and got stuck in the OP problem (task "not found in the root project"). This completely blocked assemblies, so I had to fall into Gradle.
My recovery steps on OSX (please configure for Windows):
Example: in build.gradle you have this plugin:
dependencies { classpath "com.android.tools.build:gradle:0.12.+" }
You can try switching it to the exact version, for example:
dependencies { classpath "com.android.tools.build:gradle:0.12.2" }
and (after recording which version you are changing in each case), checking that each build.gradle file in your project pulls out the same version of the plugin. Saving "+" should work (for 0.12.0, 0.12.1, 0.12.2, etc.), but my build ended when I updated the Googles Volley library (originally gradle: 0.8. +) And my main project (initially 0.12. +) Before the fixed version: gradle: 0.12.2.
Other checks
If you see this ...
In my latest builds, I continued to see terrible failures (exception pages), but after a few seconds the messages were cleared, built successfully and the application was deployed. Since I could never explain this, and the application worked, I never noticed that I had two Gradle plugins in my project. So I think Gradle plugins fought each other; one crashed, the other lost his condition and reported an error.
If you have the time, the 1-hour video “A Gentle Introduction to Gradle” (www.youtube.com/watch?v=OFUEb7pLLXw) really helped me get to the build files, tasks, building Gradle solutions, etc.
Renouncement
I study this whole stack in a foreign OS, working in a different career ... all at the same time and under pressure. In the past few months, I have run into every wall, I think Android has; I have been here quite often, and this is my first post. I thought this was a difficult decision, so I sincerely apologize if the quality of my answer reflects the difficulty that I encountered.