Okio warning while implementing Proguard rules

Viewed 976

Already implemented below given solution but none of them are working still facing below listed warning.

Warning: okio.DeflaterSink: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement Warning: okio.Okio: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement Warning: okio.Okio: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement Warning: retrofit2.Platform$Java8: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement

image

2 Answers

Add these lines into your proguard-rules.pro:

-keep class sun.misc.Unsafe { *; }
-dontwarn java.nio.file.*
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
-dontwarn okio.**

EDIT: try to add this:

proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

into release buildType.

Adding below lines to the proguard will ignore these warnings solution from here

-dontwarn okhttp3.**
-dontwarn okio.**
-dontwarn retrofit2.Platform$Java8
-dontwarn javax.annotation.**
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
Related