ZaBlanc
ZaBlanc

Reputation: 4718

Android Studio can't even build/run my app anymore

I've been getting this error from time to time, but now I can't run my app at all. I don't even know that bundleDebug is legit as a target either...it doesn't show up when I run gradlew tasks.

It's not version specific, I've seen it through two updates.

Anyone else seeing this?

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

Upvotes: 1

Views: 7402

Answers (3)

Vladislav Lipskiy
Vladislav Lipskiy

Reputation: 31

There is a bug filed here https://code.google.com/p/android/issues/detail?id=57229

task assemble{} workaround works, but you should note that if any of your subprojects has similar structure (root -> library) you'll have to add task assemble{} there too. E.g. if you add ActionBarSherlock as a GIT submodule, you should add the workaround to build.gradle file in ActionBarSherlock root directory.

Upvotes: 1

Noah
Noah

Reputation: 15320

If you get the message: Task 'assemble' not found in root project then your project is misconfigured.

This issue shows up because of 2 reasons:

  1. An "android" facet added to the root Studio module, when the root module is not supposed to be built. To fix this go to the root .iml file, open it and check if it has this XML element:

If you do, remove it. The only valid case for a root module to have this facet is it meant to be built by Gradle.

  1. Studio modules that do not have the "android" facet. This happens when adding Studio modules manually (e.g. through the "Project Structure" dialog.) Studio will try to build all the modules in your projects using Gradle. When Studio finds a module that does not have the "android" facet, it assumes it is a Java library and tries to build it with the default task "assemble".

One other hack ... In your root build.gradle script, add:

task assemble{}

Upvotes: 6

DDS
DDS

Reputation: 590

I resolved it by these steps:

1) firstly I tried to delete all lines with

<option name="ASSEMBLE_TASK_NAME" value="bundleDebug" />

from all my iml files and I got another error "Task 'assemble' not found in root project"

2) then I deleted Android asset from root project and error disapeared

Seems like Android asset is a key

Upvotes: -1

Related Questions