9

Updating Android Studio from 1.1.0 to 1.2 RC0 broke my (previously flawlessly running) project. The error message is:

TaskSelectionException: Task 'generateDebugTestSources' not found in project ':libraries:android-simple-facebook:Simple Facebook'. Some candidates are: 'generateDebugResources'.

What does that mean? And how can it be fixed? Any advice is appreciated. Thank you.

SePröbläm
  • 5,142
  • 6
  • 31
  • 45
  • Maybe this is relevant: http://stackoverflow.com/questions/28777705/how-to-make-android-studio-1-1-call-generatedebugtestsources-instead-of-assemble ? – RaGe Apr 22 '15 at 17:50
  • Thanks for the reply, unfortunately I don't see how it relates. Can you please explain in a little detail? I'm utterly new to Graddle, and it's giving me a hard time. – SePröbläm Apr 22 '15 at 19:58
  • The answer on the other question looks to me like something changed in the way unit tests are handled around AS1.1. Not sure if this is related to your issue, but see step#5 [here](http://tools.android.com/tech-docs/unit-testing-support) – RaGe Apr 22 '15 at 20:25

2 Answers2

10

I got this error after I renamed the project.

Solution is: Press on the "Sync Project With Gradle Files" once. After this the error will be gone. enter image description here

David Aleksanyan
  • 2,953
  • 4
  • 29
  • 39
  • After I imported a project created from AS 1.02 to AS 1.4.1, I got the same issue. It works by pressing "Sync Project With Gradle Files" once. But what does "Sync Project with Gradle Files" do? – Gordon Liang Nov 22 '15 at 04:23
  • Essentially it executes ./gradlew clean command which uses your project's gradle wrapper to execute your project's clean task. Usually, this just means the deletion of the build directory. – David Aleksanyan Jan 28 '16 at 22:36
0

I got the same error,too. It's seems like when I update gradle to 1.3, AS missing something. I tried run ./gradlew clean in project root directory, it will install all requires and finally build success.

Danny Liao
  • 63
  • 1
  • 6