Gradle Build failed: Task 'stacktrace' not found in root project
<p>I know this question is asked many times, and i used all the Answers to to resolve my error. Here is my problem.
I tried almost all Answer present on So, so please before mark my question as Duplicate, please read my question care, i mentioned all steps that are answered on SO Questions.     </p>

<p>Whenever i tried to <strong>run / build / clean project</strong> i got error <strong>* What went wrong:
Task 'stacktrace' not found in root project 'project'.</strong></p>

<p>Library and Sdk i m using 
ViewPagerIndicator - JakeWharton
Facebook SDK
PDK (Pinterest sdk)
gcm.jar
httpcore-4.4.4.jar</p>

<p>What i have tried so far</p>

<ol>
<li>changed Gradle version from 2.2.1-all.zip to lower version </li>
<li>changes Gradle Build version</li>
<li>delete all Library and run </li>
<li>All library project minSdkVersion same (my project using minSdkVersion: 11 )</li>
<li>clean project and Rebuild</li>
<li>Invalidate cache and restart Android Studio</li>
<li>delete .idea and .gradle folder then Import project </li>
<li>Created new project and copy paste old Project into project but it also gives same error on build </li>
<li>deleted .gradle folder from user folder(i m using windows 7 ) </li>
<li>try to build project using command line</li>
<li>Changed JDK version new jdk1.8.0_73 ( my project was build on jdk1.7.0_55 ) <a href="https://code.google.com/p/android/issues/detail?id=76360" rel="nofollow noreferrer">here is thread that said using new JDK version will resolve problem</a> </li>
<li>here are Answers i follwed <a href="https://stackoverflow.com/questions/25172006/android-studio-build-fails-with-task-not-found-in-root-project-myproject"><strong>first solution</strong></a> , <strong><a href="https://stackoverflow.com/questions/16753798/android-project-myproject-not-found-in-root-project-myproject">Second solution</a></strong>, <a href="https://stackoverflow.com/questions/14093024/trying-gradle-build-task-build-not-found-in-root-project">third solution</a>   <a href="https://stackoverflow.com/questions/25172006/android-studio-build-fails-with-task-not-found-in-root-project-myproject">Fourth Answer</a> and many more. </li>
</ol>

<p>Temporary solution(it was working before but not now )
i have backup of project two week ago, i import that backup project and replace the files and it works 
But when i do clean project error came again</p>

<p>here is app level build.gradle file</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "XXX"
        minSdkVersion 11
        targetSdkVersion 23
        multiDexEnabled true

    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
    compile 'com.android.support:support-v4:23.1.1'
    compile project(':library')
    compile files('libs/picasso-2.5.2.jar')
    compile files('libs/jsoup-1.8.3.jar')
    compile files('libs/httpcore-4.4.4.jar')
    compile 'com.google.android.gms:play-services:8.3.0'
    compile files('libs/gcm.jar')
    compile 'com.facebook.android:facebook-android-sdk:[4,5)'

}
android {
    useLibrary 'org.apache.http.legacy'
}</code></pre>
</div>
</div>
</p>

<p>Here is proejct level builld.gradle file   </p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.5.0'
        classpath 'com.google.gms:google-services:1.5.0-beta2'


    }
}

allprojects {
    repositories {
        jcenter()
    }
}</code></pre>
</div>
</div>
</p>

<p>Help will be Appreciated!. Please share your ideas to resolve this error 
i m trying to deal with error from 1 week and i  m not getting answer from anywhere that will work for me</p>

<p>thanks   </p>