Memory Leak (LeakCanary)

I have some problems with app crashes after a few hours.
Maybe a memory leak.
Does anyone have experience with LeakCanary?
And using in an Ionic / Cordova project. …
I already modified the file build.gradle and added the dependencies:

debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.2'
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.2'
androidTestCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.2'

The build fails on:

Could not find method debugImplementation() for arguments [com.squareup.leakcanary:leakcanary-android:1.6.2] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

To me: I’m a newbie in Java and Android Native. But I followed strictly the getting started instructions.