Android Studio build fails with “Task '' not found in root project 'MyProject'.”

前端 未结 20 1445
失恋的感觉
失恋的感觉 2020-11-30 02:31

I get this error when trying to build my project after changing laptop and updating to Android Studio version 0.8.2.

FAILURE: Build failed with an exc

相关标签:
20条回答
  • 2020-11-30 03:30

    Simple fix for me was

    1. Build > Clean project
    2. Restart Android Studio
    0 讨论(0)
  • 2020-11-30 03:31

    Remove:

    <facet type="android" name="Android">
        <configuration />
    </facet>
    

    in your iml file. That works for me.

    https://plus.google.com/+AlexRuiz/posts/49hP3V9GSGe

    0 讨论(0)
  • 2020-11-30 03:31

    Sometimes, if you have opened two windows of Android Studio, and when you try to compile, this issue might happen. For me, when I was compiling a backed Google Cloud Endpoint module which was not embedded in a project, rather shared among different Android Studio projects, and when there is more than once instance open, this error use to spring up for me. But as soon as you close other windows, everything will be fine. Sometimes, you might have to restart Android Studio altogether.

    0 讨论(0)
  • 2020-11-30 03:31

    I remove/Rename .gradle folder in c:\users\Myuser\.gradle and restart Android Studio and worked for me

    0 讨论(0)
  • 2020-11-30 03:34

    Apparently this error has multiple causes. Here's what fixed it for me.

    I was running the build command like this:

    ./gradlew :testapp: build
    

    Running it without the space fixed the issue:

    ./gradlew :testapp:build
    
    0 讨论(0)
  • 2020-11-30 03:34

    I got this problem because it could not find the Android SDK path. I was missing a local.properties file with it or an ANDROID_HOME environment variable with it.

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