在哪里可以找到 `Warnings found during shrinking` 的警告?

Where to find the warning of `Warnings found during shrinking`?

将 RxAndroid 和 Retrofit 库添加到我的 gradle 并编译后,我收到以下错误,显示在我的 Android Studio 消息面板中。

Error:Execution failed for task 
':app:transformClassesWithNewClassShrinkerForProductionDebug'.
> Warnings found during shrinking, please use -dontwarn or -ignorewarnings to suppress them.

在我的调试中,我使用

        minifyEnabled true
        useProguard false

我相信我可以使用-dontwarnignorewarnings来抑制并让编译继续。但我想知道那是什么警告。我在哪里可以找到警告?

找到了。只需打开 Gradle Console(通常是右下角的选项卡)查看 Gradle 日志。

据说

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task 
':app:transformClassesWithNewClassShrinkerForProductionDebug'.
> Warnings found during shrinking, please use -dontwarn or -ignorewarnings to suppress them.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

可选,我可能只需要在命令行上使用 --debug 选项 运行 gradlew

./gradlew :app:transformClassesWithNewClassShrinkerForInternalDebug --debug

好像默认的收缩器已经改变了。添加配置以打开 ProGuard 开始工作。

buildTypes {
    release {
        debuggable false
        minifyEnabled true
        useProguard true
        getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
    }
    debug {
        debuggable true
        minifyEnabled true
        useProguard true
        getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
    }
}