Proguard-找不到[android / database / Cursor]的常见超类

时间:2019-12-12 12:38:49

标签: java android proguard

我遇到了proguard的问题,在构建后我得到以下信息:

 (with 2 known super classes) and [com/google/android/gms/internal/measurement/zzgg] (with 1 known super classes)

在添加以下依赖项后会发生这种情况:

implementation 'com.appnexus.opensdk.mediatedviews:appnexus-googleplay-mediation:6.1.1-18.2.0'

这是我针对Google Play服务的proguard配置:

-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable,*Annotation*,Signature

#-dontskipnonpubliclibraryclasses
#-dontskipnonpubliclibraryclassmembers

-dontobfuscate

-printseeds seeds.txt
-printusage unused.txt
-printmapping mapping.txt

# ======= Google Play Services =======
-keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {
    public static final *** NULL;
}

-keepnames class * implements android.os.Parcelable
-keepclassmembers class * implements android.os.Parcelable {
  public static final *** CREATOR;
}

-keep @interface android.support.annotation.Keep
-keep @android.support.annotation.Keep class *
-keepclasseswithmembers class * {
  @android.support.annotation.Keep <fields>;
}
-keepclasseswithmembers class * {
  @android.support.annotation.Keep <methods>;
}

-keep @interface com.google.android.gms.common.annotation.KeepName
-keepnames @com.google.android.gms.common.annotation.KeepName class *
-keepclassmembernames class * {
  @com.google.android.gms.common.annotation.KeepName *;
}

-keep @interface com.google.android.gms.common.util.DynamiteApi
-keep public @com.google.android.gms.common.util.DynamiteApi class * {
  public <fields>;
  public <methods>;
}

-keep public class com.google.android.gms.* { public *; }

-dontwarn android.security.NetworkSecurityPolicy

-dontwarn com.schibsted.domain.messaging.notifications.gcm.*

我的问题是,我可以添加一些选项到proguard还是必须排除某些类来纠正此错误。 注意:我已经尝试过 -dontoptimize ,但是最终我得到的大部分警告都不允许我运行该应用程序。而通过 -dontpreverify 我最终得到

Duplicate jar entry [com/google/android/gms/measurement/AppMeasurementJobService.class]

0 个答案:

没有答案