Square LeakCanary Cannot find symbol

I am honestly surprised that

 dependencies {
   debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3'
   releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3'
 }

did not work for you, because it did for me.

Maybe you want to try it with your buildType instead of the productFlavour:

dependencies {
   someBuildTypeCompile 'com.squareup.leakcanary:leakcanary-android:1.3'
}

  1. Make sure you add the libraries to your build.gradle

    dependencies {
        debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1'
        releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.1'
    }
    
  2. add mavenCentral() to your repositories

    buildscript {
        repositories {
            jcenter()
            mavenCentral()
        }
        dependencies {
             classpath 'com.android.tools.build:gradle:1.5.0'
        }
    }
    allprojects {
         repositories {
             jcenter()
             mavenCentral()
         }
    }
    

Rebuilding the project fixed it for me.

There's a deleted answer (I don't know why) by Kaushik Gopal that gives this solution and points to a Github issue