如下一链接所述,我正在尝试启用泄漏的金丝雀去混淆。
但是,当我尝试同步gradle时,我会得到下一个错误
LeakCanary解模糊插件找不到任何已启用小型化的变体。请确保在您的项目中至少有一个小型变体。
据我所理解,泄漏金丝雀希望确保在调试中构建,但我不知道如何构建。我试图配置debuggable true,但它似乎没有帮助。
这肯定是一个基本的问题,因为我找不到谷歌的任何记录,而泄密金丝雀文档的实现说明是非常基本的。
这是我在gradle文件顶部的代码
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
// LeakCanary plugin should be added after android application or android library plugin
apply plugin: 'com.squareup.leakcanary.deobfuscation'
leakCanary {
// LeakCanary needs to know which variants have obfuscation turned on
filterObfuscatedVariants { variant ->
variant.name == "debug"
}
}
android {
compileSdkVersion 28
defaultConfig {这是我在dependencies的代码
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.2'发布于 2020-03-31 20:49:26
可能与这个LeakCanary问题有关:https://github.com/square/leakcanary/pull/1762
看来会在漏水的金丝雀2.3中修复
在尝试切换到Android插件3.6.1之后,出现了同样的问题
https://stackoverflow.com/questions/60469803
复制相似问题