Android Studio 0.4.3 - Task 'assemble' not found in root project

前端 未结 7 434
感情败类
感情败类 2020-12-03 09:31

Updated to 0.4.3 the other day and trying to start a new project, not even use an existing project, and I get this error:

FAILURE: Build failed with a

相关标签:
7条回答
  • 2020-12-03 10:13

    This worked for me. Open your parent/root build.gradle file.

    Add this at the first line: task assemble{}

    0 讨论(0)
  • 2020-12-03 10:18

    Quick Answer

    Remove everything betweeen and including the component tag

    <component name="FacetManager"> 
       ... <!-- remove all in this node 
    </component>` 
    

    Long Answer

    See http://tools.android.com/knownissues

    If you get the following error message:

    Gradle: 
    FAILURE: Could not determine which tasks to execute.
    * What went wrong:
    Task 'assemble' not found in root project 'MyProject'.
    * Try:
    Run gradle tasks to get a list of available tasks.
    

    The real problem is that previous version of Android Studio misconfigured the IDEA file (e.g. MyProject.iml) -- it added an extra "<component name="FacetManager">" XML element that shouldn't be present.
    In the case above, the solution is to edit "MyProject.iml" and to remove the entire node <component name="FacetManager"> ... </component>

    In the case of your specific project called XXX, you would be looking to correct the file called XXX.iml

    The documentation also says to "Alternatively you could remove the project's .idea folder and iml files and re-import your sources into a new Android Studio project." Not that this solution will work for you since you can't even get a new project to build.

    0 讨论(0)
  • 2020-12-03 10:27

    I had to rollback to Android 0.3.2 to get this to work with the 0.4.3 release did not work. Everything has been working fine so far.

    0 讨论(0)
  • 2020-12-03 10:30

    You might need to add settings.gradle with subprojects.

    The settings.gradle file should be placed at the root of the project and contain at least the following line:

    include ':app'
    

    Reference: https://georgik.rocks/missing-run-or-debug-action-in-android-studio/

    0 讨论(0)
  • 2020-12-03 10:30

    It worked for me just by Rebuilding the project.

    Build -> Rebuild Project

    0 讨论(0)
  • 2020-12-03 10:36

    I'm sharing how I solved it - If you remove a library. you need to remember to remove it from the settings.gradle file as well. otherwise it may build successfully through command line and not through the android studio

    0 讨论(0)
提交回复
热议问题