使用proguard的PDFTRON lib错误

时间:2015-01-27 12:09:19

标签: proguard pdftron

我的应用正在使用pdftron lib(PDFViewCtrlTools)。这里有Utils.java类和以下方法:

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);
    }
}

构建应用程序时,我遇到以下错误:

 [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'?

在使用项目库BuildConfig.DEBUG时,有更多人遇到问题,但我找不到任何解决方案。

只有在使用tools / proguard / proguard-android-optimize.txt而不是tools / proguard / proguard-android.txt时出现问题

1 个答案:

答案 0 :(得分:0)

您是否尝试过添加以下内容?

-keep class com.pdftron.pdf.tools.BuildConfig {*; }