Note. Com.google.common.cache.Striped64 dynamically accesses the declared base field

I am using ProGuard with my Android Studio project. When I create a release, I get the following note:

Note: com.google.common.cache.Striped64 accesses a declared field 'base' dynamically
      Maybe this is program field 'com.google.common.cache.Striped64 { long base; }'
      Maybe this is program field 'org.jsoup.nodes.Entities { java.util.Map base; }'
      Maybe this is program field 'org.jsoup.nodes.Entities$EscapeMode { org.jsoup.nodes.Entities$EscapeMode base; }'

I tried to solve this problem with

-keep class org.jsoup.** { *; }
-keeppackagenames org.jsoup.nodes
-keep class com.google.common.cache.Striped64 { *; }
-keep class com.google.common.base.** { *; }

but it did not help.

How to eliminate this note?

+4
source share
1 answer

To fix this, you must provide the following proguard configuration:

-keepclassmembers class ** {
  ** base;
}

It just means that you are not renaming all members with the name "base" of any type in any class.

It works like a charm.

+4
source

Source: https://habr.com/ru/post/1611218/


All Articles