My app is using the pdftron lib (PDFViewCtrlTools). Here there is the class Utils.java and following methods:
public static void debugLogD(String tag, String msg) {
if (BuildConfig.DEBUG) {
Log.d(tag, msg);
}
}
public static void debugLogV(String tag, String msg) {
if (BuildConfig.DEBUG) {
Log.v(tag, msg);
}
}
I am getting following error when release building the app:
[proguard] Initializing...
[proguard] Warning: pdftron.PDF.Utils.Utils: can't find referenced class com.pdftron.pdf.tools.BuildConfig
[proguard] Note: android.support.v4.text.ICUCompatIcs: can't find dynamically referenced class libcore.icu.ICU
[proguard] Note: com.google.android.gms.internal.av calls '(com.google.ads.mediation.MediationAdapter)Class.forName(variable).newInstance()'
[proguard] Note: com.google.android.gms.maps.internal.q: can't find dynamically referenced class com.google.android.gms.maps.internal.CreatorImpl
[proguard] Note: com.google.api.client.util.IOUtils: can't find dynamically referenced class java.nio.file.Files
[proguard] Note: com.google.api.client.util.IOUtils: can't find dynamically referenced class java.nio.file.Path
[proguard] Note: com.google.gson.internal.UnsafeAllocator: can't find dynamically referenced class sun.misc.Unsafe
[proguard] Note: com.sophos.jbase.JBKeyStore: can't find dynamically referenced class android.os.ServiceManager
[proguard] Note: com.sophos.jbase.PRNGFixes: can't find dynamically referenced class org.apache.harmony.xnet.provider.jsse.NativeCrypto
[proguard] Note: com.sophos.jbase.PRNGFixes: can't find dynamically referenced class org.apache.harmony.xnet.provider.jsse.NativeCrypto
[proguard] Note: com.squareup.okhttp.internal.Platform: can't find dynamically referenced class com.android.org.conscrypt.OpenSSLSocketImpl
[proguard] Note: com.squareup.okhttp.internal.Platform: can't find dynamically referenced class org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl
[proguard] Note: the configuration refers to the unknown class 'com.google.vending.licensing.ILicensingService'
[proguard] Note: the configuration refers to the unknown class 'com.android.vending.licensing.ILicensingService'
[proguard] Note: the configuration refers to the unknown class 'com.pdftron.pdf.tools.BuildConfig'
[proguard] Maybe you meant the fully qualified name 'com.company.product.BuildConfig'?
There are more people having problems when in a project library BuildConfig.DEBUG is used, but I could not find any solution yet for this.
The problem appears only when using tools/proguard/proguard-android-optimize.txt instead of tools/proguard/proguard-android.txt