Android Studio build fails with “Task '' not found in root project 'MyProject'.”

前端 未结 20 1553
失恋的感觉
失恋的感觉 2020-11-30 02:31

I get this error when trying to build my project after changing laptop and updating to Android Studio version 0.8.2.

FAILURE: Build failed with an exc

20条回答
  •  青春惊慌失措
    2020-11-30 03:20

    I got this error when switching from one Git branch to another, and then trying to run "Clean Project". I used ack to search for the Task name, and found it in a .iml file.

    My solution was to regenerate the project's .iml file by clicking (in the main menu) Tools > Android > Sync Project with Gradle Files. (Thanks to this answer.)

提交回复
热议问题