Android Studio 1.4 - Task 'assemble' not found in root project 'bin'

10,596

Solution 1

On Linux you can use this command:

gradlew assembleDebug

There are two files to execute Gradle:

  1. gradlew.bat for Windows
  2. gradlew for Linux

Solution 2

I also suffered with the same issue, but it was resolved for me.

In my case "Settings.gradle" file was missing. once I added it was resolved for me.

Share:
10,596
Curtis
Author by

Curtis

Updated on June 23, 2022

Comments

  • Curtis
    Curtis almost 2 years

    I upgraded yesterday to Android Studio 1.4. Before the upgrade I could run a Gradle assemble under Run/Debug configurations with "assemble" in the tasks field.

    Now, I am getting the following error:

    3:22:48 PM: Executing external task 'assemble'...

    FAILURE: Build failed with an exception.

    • What went wrong: Task 'assemble' not found in root project 'bin'.

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

    BUILD FAILED

    Total time: 0.095 secs Task 'assemble' not found in root project 'bin'. 3:22:48 PM: External task execution finished 'assemble'.

    I tried adding "task assemble{}" to the root build.gradle file according to this StackOverflow question and Google Code forums. This did not work.

    I also tried removing

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

    according to this answer on Stack Overflow. My root build.gradle is the following:

    // Top-level build file where you can add configuration options common to all sub-projects/modules.
    
    buildscript {
        repositories {
            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:1.3.0'
    
         // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        }
    
    }
    
    
    allprojects {
        repositories {
            jcenter()
        }
    }
    

    I also tried importing the files as a new Android Studio project. I was able to generate an app-debug.apk by running it through the emulator though. I also tried cloning my Bitbucket repository to the last committed version from yesterday to import into Android Studio and that didn't work either. I'm fairly new to Android things and am stumped with this. Any help is appreciated.

    EDIT-- I solved the problem, and am posting so it may help someone else. I was able to assemble from the command line. I'm on Windows, so the command was:

    gradlew.bat assembleDebug

    This worked. I completely exited Android Studio. I'm not sure if this step is important or not. I then opened the Gradle sidebar and it was empty. I hit the refresh button and suddenly the Gradle tasks showed up again and was able to run the Gradle APK assemble from the Run option again.