Proguard抛出customtabs警告并生成失败

时间:2018-08-15 08:06:31

标签: android android-proguard

我刚刚在一个项目中添加了一个带有Viewpager的活动,其中包含片段和滑动操作,而proguard却疯了。这是警告列表:

Warning: com.google.android.gms.internal.zzfts: can't find superclass or interface android.support.customtabs.CustomTabsServiceConnection
Warning: com.google.android.gms.internal.zzfts: can't find referenced class android.support.customtabs.CustomTabsClient
Warning: com.google.android.gms.internal.zzfts: can't find referenced class android.support.customtabs.CustomTabsServiceConnection
Warning: com.google.android.gms.internal.zzfts: can't find referenced class android.support.customtabs.CustomTabsServiceConnection
Warning: com.google.android.gms.internal.zzfts: can't find referenced class android.support.customtabs.CustomTabsClient
Warning: com.google.android.gms.internal.zzftt: can't find referenced class android.support.customtabs.CustomTabsClient
Warning: com.google.android.gms.internal.zzoe: can't find referenced class android.support.customtabs.CustomTabsClient
Warning: com.google.android.gms.internal.zzoe: can't find referenced class android.support.customtabs.CustomTabsSession
Warning: com.google.android.gms.internal.zzoe: can't find referenced class android.support.customtabs.CustomTabsClient
Warning: com.google.android.gms.internal.zzoe: can't find referenced class android.support.customtabs.CustomTabsClient
Warning: com.google.android.gms.internal.zzoe: can't find referenced class android.support.customtabs.CustomTabsClient
Warning: com.google.android.gms.internal.zzoe: can't find referenced class android.support.customtabs.CustomTabsSession
Warning: com.google.android.gms.internal.zzoe: can't find referenced class android.support.customtabs.CustomTabsSession
Warning: com.google.android.gms.internal.zzoe: can't find referenced class android.support.customtabs.CustomTabsClient
Warning: com.google.android.gms.internal.zzoe: can't find referenced class android.support.customtabs.CustomTabsServiceConnection
Warning: com.google.android.gms.internal.zzoe: can't find referenced class android.support.customtabs.CustomTabsClient
Warning: com.google.android.gms.internal.zzwl: can't find referenced class android.support.customtabs.CustomTabsIntent
Warning: com.google.android.gms.internal.zzwl: can't find referenced class android.support.customtabs.CustomTabsIntent$Builder
Warning: com.google.android.gms.internal.zzwl: can't find referenced class android.support.customtabs.CustomTabsIntent
Warning: com.google.android.gms.internal.zzwl: can't find referenced class android.support.customtabs.CustomTabsIntent$Builder
Warning: com.google.android.gms.internal.zzwl: can't find referenced class android.support.customtabs.CustomTabsIntent$Builder

这是我的proguard规则文件的状态:

 #-libraryjars   libs/android-support-v4.jar
 -dontwarn android.support.**
 #-keep class android.support.v4.** { *; }
 #-keep interface android.support.v4.app.** { *; }
 #-keepattributes *Annotation*

-keep public class * implements com.bumptech.glide.module.GlideModule
-keep public class * extends com.bumptech.glide.module.AppGlideModule
-keep public enum com.bumptech.glide.load.ImageHeaderParser$** {
  **[] $VALUES;
  public *;
}

 # for DexGuard only
 #-keepresourcexmlelements manifest/application/meta-data@value=GlideModule

2 个答案:

答案 0 :(得分:0)

此警告是因为您缺少Proguard进程对android支持jar的引用。

尝试将libraryjars添加回您的 -dontwarn android.support.** -keep class android.support.** 参数。例如。

{{1}}

答案 1 :(得分:0)

将此规则添加到您的ProGuard配置中:

-keep,includedescriptorclasses class android.support.customtabs.** { *; }