Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 712
Elye Avatar asked Jun 06 '17 12:06

Elye


2 Answers

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
like image 97
Elye Avatar answered Nov 01 '22 19:11

Elye


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'
    }
}
like image 45
Devangi Avatar answered Nov 01 '22 20:11

Devangi