title: Gradle Sync Failed but Project is running without error
body: <p>I know it is very strange. I've started Android studio today and "Gradle Sync Failed" message started to being shown with no error. Everything was working fine till I last closed the Android Studio yesterday. Then I tried to run the project, it runs successfully but still, the Gradle sync error is showing and XML layout preview is not displaying due to gradle sync error. I tried the following things to get rid of it:</p>
  
  <ol>
  <li>run the command <code>gradlew clean build --stacktrace</code></li>
  <li><code>gradlew clearBuildCache</code></li>
  <li>Invalidate/Restart Android Studio</li>
  <li>Delete <code>.gradle</code> folder in C:\Users</li>
  <li>Deleted the <code>app/build</code> folders manually</li>
  </ol>
  
  <p>Following are the gradle log.</p>
  
  <pre><code>INFO - e.project.sync.GradleSyncState - Started setup of project 'projectName'. 
  INFO - idea.project.IndexingSuspender - Consuming IndexingSuspender activation event: SETUP_STARTED 
  INFO - e.project.sync.GradleSyncState - Gradle sync failed (29 s 70 ms) 
  INFO - idea.project.IndexingSuspender - Consuming IndexingSuspender deactivation event: SYNC_FINISHED 
  INFO - idea.project.IndexingSuspender - Finishing batch update for project: Project 
  </code></pre>
  
  <p><strong>PS:</strong> It's nothing wrong with Android Studio because it's working fine with Another project.</p>
  
  <p><strong>Edit</strong></p>
  
  <p>Here is my <strong>app/build.gradle</strong></p>
  
  <pre><code>apply plugin: 'com.android.application'
  apply plugin: 'kotlin-android'
  apply plugin: 'kotlin-kapt'
  apply plugin: 'io.fabric'
  
  android {
      compileSdkVersion 27
  
      lintOptions {
          abortOnError false
      }
  
      signingConfigs {
          release {
              keyAlias 'xxxx'
              keyPassword 'xxxxx'
              storeFile file('../keystore/xxxx-xxxx.jks')
              storePassword 'xxxxxx'
          }
      }
  
      defaultConfig {
          applicationId "xxxx.xxxxxx.xxxxxx.xxxx.app"
          minSdkVersion 19
          targetSdkVersion 27
          versionCode 1
          versionName "1.0"
          dataBinding {
              enabled = true
          }
          vectorDrawables.useSupportLibrary = true
  
          externalNativeBuild {
              cmake {
                  cppFlags ""
              }
          }
  
      }
  
      externalNativeBuild {
          cmake {
              path "CMakeLists.txt"
          }
      }
      buildTypes {
  
          debug {
              versionNameSuffix "-dev"
              minifyEnabled false
  
              signingConfig signingConfigs.release
          }
  
          release {
              minifyEnabled true
              proguardFiles /*getDefaultProguardFile('proguard-android.txt'),*/ 'proguard-rules.pro'
              signingConfig signingConfigs.release
          }
      }
  
  }
  
  dependencies {
      implementation fileTree(include: ['*.jar'], dir: 'libs')
      implementation 'com.android.support:appcompat-v7:27.1.1'
      implementation 'com.android.support.constraint:constraint-layout:1.1.3'
  
      //Other
      implementation 'com.android.support:multidex:1.0.3'
      implementation 'com.android.support:design:27.1.1'
      implementation 'com.android.support:cardview-v7:27.1.1'
      implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
      implementation 'com.crealsolutions.real-lib:real-lib:1.0.4'
  
      //View
      implementation 'com.wang.avi:library:2.1.3'
      implementation 'com.android.support:recyclerview-v7:27.1.1'
      implementation 'com.intuit.sdp:sdp-android:1.0.5'
      implementation 'com.intuit.ssp:ssp-android:1.0.5'
      implementation 'com.joooonho:selectableroundedimageview:1.0.1'
  
      // Retrofit2
      implementation 'com.squareup.retrofit2:retrofit:2.4.0'
      implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
      implementation 'com.squareup.okhttp3:logging-interceptor:3.9.1'
  
      //Glide
      implementation 'com.github.bumptech.glide:glide:4.6.1'
      kapt 'com.github.bumptech.glide:compiler:4.6.1'
      implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
  
      //Firebase
      implementation 'com.google.firebase:firebase-core:16.0.4'
      implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
  
      //Fingerprint
      implementation 'me.aflak.libraries:fingerprint:2.5.3'
  
      //OTP View
      implementation 'com.chaos.view:pinview:1.4.2'
  }
  apply plugin: 'com.google.gms.google-services'
  </code></pre>
  
  <p>and here is the <strong>project/build.gradle</strong></p>
  
  <pre><code>buildscript {
      ext.kotlin_version = '1.2.71'
  
      repositories {
  
          google()
  
          jcenter()
  
          mavenCentral()
  
          maven {
              url 'https://maven.google.com/'
          }
          maven {
              url 'https://maven.fabric.io/public'
          }
          maven {
              url 'https://dl.bintray.com/kotlin/kotlin-dev/'
          }
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:3.2.1'
          classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
          classpath 'com.google.gms:google-services:4.1.0'
          classpath 'io.fabric.tools:gradle:1.25.4'
          // NOTE: Do not place your application dependencies here; they belong
          // in the individual module build.gradle files
      }
  }
  
  allprojects {
      repositories {
          google()
          jcenter()
          mavenCentral()
          maven {
              url 'https://maven.google.com/'
          }
          maven {
              url 'https://maven.fabric.io/public'
          }
          maven {
              url 'https://dl.bintray.com/kotlin/kotlin-dev/'
          }
      }
  }
  
  task clean(type: Delete) {
      delete rootProject.buildDir
  }
  </code></pre>