0

我的应用程序正在使用 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 时才会出现问题

4

1 回答 1

0

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

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

于 2015-01-27T18:24:28.293 回答