I am getting below build errors when I am running the app in Android Studio 2. These errors were not there when I was using earlier version of Android Studio.
I solved the issue by adding following dependency to my build.gradle:
testCompile "com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta2"
here is link:https://github.com/square/leakcanary/issues/491