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

不想你离开。 提交于 2019-12-23 09:49:49

问题


After adding RxAndroid and Retrofit library to my gradle, and compile, I got the below error, shows in my Android Studio Message panel.

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

In my Debug, I use

        minifyEnabled true
        useProguard false

I believe I could use -dontwarn or ignorewarnings to suprress and let the compilation continue. But I would like to know what warnings was that. Where could I find the warning?


回答1:


Found it. Just need to open the Gradle Console (normally a tab at the right bottom) to look at the Gradle Log.

It is stated

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.

Optionally, I could just need to run the gradlew on command line with the --debug option.

./gradlew :app:transformClassesWithNewClassShrinkerForInternalDebug --debug



回答2:


It is like the default shrinker has changed. Adding the configuration to turn on ProGuard started to work.

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'
    }
}


来源:https://stackoverflow.com/questions/44389680/where-to-find-the-warning-of-warnings-found-during-shrinking

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!