导入/打开项目后项目模块中断(未找到Task generateDebugSources)

时间:2014-12-26 12:54:19

标签: java android android-studio

我从AndroidStudio开始,在尝试将项目导出到版本控件时出错:

Error:FAILURE: Build failed with an exception.

* What went wrong:
Task 'generateDebugSources' not found in project ':app'.

* Try:
Run gradle tasks to get a list of available tasks. Run with --stacktrace option to get 
  the stacktrace. Run with --info or --debug option to get more log output.

重现的步骤是:

  • 创建新项目
  • 将项目导入SVN服务器,不包括.gitignore中的文件:

    The folder .gradle
    The file .idea/workspace.xml
    The file local.properties
    The folder .idea/libraries
    The folders build
    
  • 从版本控制中签出项目,在AndroidStudio中选择文件/打开..并打开导出的项目

我该如何解决?

2 个答案:

答案 0 :(得分:1)

就我而言,当我尝试打开最初使用Eclipse& amp;创建的项目时,我遇到了这个错误。 ADT。

要解决它,请尝试"导出"从Eclipse中获取文件,然后将其导入Android工作室(当我尝试这样做时崩溃了,但那是另一个故事)。如果这也是你的情况,请看这个链接:

http://tools.android.com/tech-docs/new-build-system/migrating-from-eclipse-projects

答案 1 :(得分:0)

我发现了问题:

递归地添加.gradle也忽略了文件app / build.gradle文件,打破了编译过程