Proguard未解决的对类的引用 [英] Proguard unresolved references to classes

查看:199
本文介绍了Proguard未解决的对类的引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当使用Proguard构建apk时,我看到了这些警告:

  com.google.android.gms.internal.zzaq:无法找到引用类com.google.android.gms.internal.zzzk 
com.google.android.gms.internal.zzaq:找不到引用类com.google.android.gms.internal.zzzk $ zza
com.google.android.gms.internal.zzaq:无法找到引用的类com.google.android.gms.internal.zzzk
com.google.android.gms.internal.zzaq :无法找到引用的类com.google.android.gms.internal.zzzk $ zza
com.google.android.gms.internal.zzaq:找不到引用的类com.google.android.gms。 internal.zzzk $ zza
com.google.android.gms.internal.zzaq:无法找到引用的类com.google.android.gms.internal.zzzk $ zza
com.google.android。 gms.internal.zzaq:无法找到引用的类com.google.android.gms.internal.zzzk
com.google.android.gms.internal.zzaq $ 1:找不到引用的类com.google。 android.gms.internal.zzzk
com.google.andr oid.gms.internal.zzaq $ 1:无法找到引用的类com.google.android.gms.internal.zzzk
com.google.android.gms.internal.zzbd:无法找到引用的类com。 google.android.gms.internal.zzaqg
com.google.android.gms.internal.zzbd:无法找到引用的类com.google.android.gms.internal.zzzk
com.google。 android.gms.internal.zzbd:无法找到引用的类com.google.android.gms.internal.zzzk
com.google.android.gms.internal.zzbd:找不到引用的类com.google .android.gms.internal.zzaqg
com.google.android.gms.internal.zzej:在程序类com.google.android.gms.R $ styleable中找不到引用字段'int [] AdsAttrs'
com.google.android.gms.internal.zzej:在程序类com.google.android.gms.R $ styleable
com.google.android中找不到引用字段'int AdsAttrs_adSize'。 gms.internal.zzej:在程序类com.google.android.gms.R $ styleable
com.google.a中找不到引用字段'int AdsAttrs_adSizes' ndroid.gms.internal.zzej:在程序类com.google.android.gms.R $ styleable

中找不到引用字段'int AdsAttrs_adUnitId'

我使用Google Play服务10.2.0,模块广告,ads-lite,analytics,analytics-impl,基地,地下室,硬盘,游戏和任务。



需要包含哪些模块或库来修复这些警告?

解决方案

这个线程,如果您使用ProGuard,您需要保留一些GMS(Google Play服务)类,并使用 @ com.google.android.gms.common.annotation.KeepName 注释它们。


你需要忽略你正在编译的内容,但是你也需要保留这个类,以便在运行时找到它。



将这两行添加到您的proguard配置文件中:

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


您也可以查看这些相关的SO帖子: b
$ b


When building apk using Proguard, I see theses Warnings:

com.google.android.gms.internal.zzaq: can't find referenced class com.google.android.gms.internal.zzzk
com.google.android.gms.internal.zzaq: can't find referenced class com.google.android.gms.internal.zzzk$zza
com.google.android.gms.internal.zzaq: can't find referenced class com.google.android.gms.internal.zzzk
com.google.android.gms.internal.zzaq: can't find referenced class com.google.android.gms.internal.zzzk$zza
com.google.android.gms.internal.zzaq: can't find referenced class com.google.android.gms.internal.zzzk$zza
com.google.android.gms.internal.zzaq: can't find referenced class com.google.android.gms.internal.zzzk$zza
com.google.android.gms.internal.zzaq: can't find referenced class com.google.android.gms.internal.zzzk
com.google.android.gms.internal.zzaq$1: can't find referenced class com.google.android.gms.internal.zzzk
com.google.android.gms.internal.zzaq$1: can't find referenced class com.google.android.gms.internal.zzzk
com.google.android.gms.internal.zzbd: can't find referenced class com.google.android.gms.internal.zzaqg
com.google.android.gms.internal.zzbd: can't find referenced class com.google.android.gms.internal.zzzk
com.google.android.gms.internal.zzbd: can't find referenced class com.google.android.gms.internal.zzzk
com.google.android.gms.internal.zzbd: can't find referenced class com.google.android.gms.internal.zzaqg
com.google.android.gms.internal.zzej: can't find referenced field 'int[] AdsAttrs' in program class com.google.android.gms.R$styleable
com.google.android.gms.internal.zzej: can't find referenced field 'int AdsAttrs_adSize' in program class com.google.android.gms.R$styleable
com.google.android.gms.internal.zzej: can't find referenced field 'int AdsAttrs_adSizes' in program class com.google.android.gms.R$styleable
com.google.android.gms.internal.zzej: can't find referenced field 'int AdsAttrs_adUnitId' in program class com.google.android.gms.R$styleable

I'm using Google Play Services 10.2.0, modules ads, ads-lite, analytics, analytics-impl, base, basement, drive, games, tasks.

What modules or libraries need to be included to fix those warnings?

解决方案

Based from this thread, if you use ProGuard, you need to keep some GMS (Google Play Services) classes and they are annotated with @com.google.android.gms.common.annotation.KeepName.

You need to ignore like you are compiling but you also need to keep the class so it can find it during runtime.

Add these two lines to your proguard configuration file:

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

You may also check these related SO posts:

这篇关于Proguard未解决的对类的引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆