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

佐手、 提交于 2019-11-27 14:17:23
Stephan Branczyk

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.

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

Add this as the first line: task assemble{}

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.

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

palimad

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/

Try to run for new versions of gradle

$ gradle init

It will create initial build.gradle. To see all gradle comands just run

$ gradle
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!