【问题标题】:Unable to Build apk after minifyEnabled true在 minifyEnabled true 后无法构建 apk
【发布时间】:2017-08-23 17:15:09
【问题描述】:

我想减小 APK 大小,所以我启用了minifyEnabled。启用 minifyEnabled 后,我在 gradle 控制台中遇到了这个错误,我在我的 proguard-rules.pro 文件中做了一些更改

我根本不想使用 Twitter、Facebook、Exoplayer 代码,但无法让proguard 删除这些代码。

但还是无法构建apk:

Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zzaa { void zza(java.util.List,java.util.List,com.google.android.gms.dynamic.IObjectWrapper,long); }', but not the descriptor class 'com.google.android.gms.dynamic.IObjectWrapper'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zzaa { void zzN(com.google.android.gms.dynamic.IObjectWrapper); }', but not the descriptor class 'com.google.android.gms.dynamic.IObjectWrapper'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zzac { zzac(com.google.android.gms.internal.og); }', but not the descriptor class 'com.google.android.gms.internal.og'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zzae { void zza(boolean,com.google.android.gms.internal.oh); }', but not the descriptor class 'com.google.android.gms.internal.oh'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zzaf { zzaf(com.google.firebase.database.connection.idl.zzae,com.google.android.gms.internal.oh); }', but not the descriptor class 'com.google.android.gms.internal.oh'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zzc { zzc(com.google.android.gms.internal.ok,com.google.android.gms.internal.wh,java.util.List,boolean,java.lang.String,java.lang.String); }', but not the descriptor class 'com.google.android.gms.internal.ok'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zzc { zzc(com.google.android.gms.internal.ok,com.google.android.gms.internal.wh,java.util.List,boolean,java.lang.String,java.lang.String); }', but not the descriptor class 'com.google.android.gms.internal.wh'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zze { com.google.firebase.database.connection.idl.zze zza(android.content.Context,com.google.firebase.database.connection.idl.zzc,com.google.android.gms.internal.oi,com.google.android.gms.internal.on); }', but not the descriptor class 'com.google.android.gms.internal.oi'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zze { com.google.firebase.database.connection.idl.zze zza(android.content.Context,com.google.firebase.database.connection.idl.zzc,com.google.android.gms.internal.oi,com.google.android.gms.internal.on); }', but not the descriptor class 'com.google.android.gms.internal.on'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zze { void zza(java.util.List,java.util.Map,com.google.android.gms.internal.ol,java.lang.Long,com.google.android.gms.internal.pe); }', but not the descriptor class 'com.google.android.gms.internal.ol'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zze { void zza(java.util.List,java.util.Map,com.google.android.gms.internal.ol,java.lang.Long,com.google.android.gms.internal.pe); }', but not the descriptor class 'com.google.android.gms.internal.pe'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zze { void zza(java.util.List,java.lang.Object,com.google.android.gms.internal.pe); }', but not the descriptor class 'com.google.android.gms.internal.pe'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zze { void zza(java.util.List,java.lang.Object,java.lang.String,com.google.android.gms.internal.pe); }', but not the descriptor class 'com.google.android.gms.internal.pe'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zze { void zza(java.util.List,java.util.Map,com.google.android.gms.internal.pe); }', but not the descriptor class 'com.google.android.gms.internal.pe'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zze { void zzb(java.util.List,java.lang.Object,com.google.android.gms.internal.pe); }', but not the descriptor class 'com.google.android.gms.internal.pe'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zze { void zzb(java.util.List,java.util.Map,com.google.android.gms.internal.pe); }', but not the descriptor class 'com.google.android.gms.internal.pe'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zze { void zza(java.util.List,com.google.android.gms.internal.pe); }', but not the descriptor class 'com.google.android.gms.internal.pe'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zze { com.google.firebase.database.connection.idl.zzag zza(com.google.android.gms.internal.pe); }', but not the descriptor class 'com.google.android.gms.internal.pe'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zzf { zzf(com.google.firebase.database.connection.idl.zze,com.google.android.gms.internal.ol); }', but not the descriptor class 'com.google.android.gms.internal.ol'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zzg { zzg(com.google.android.gms.internal.pe); }', but not the descriptor class 'com.google.android.gms.internal.pe'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zzs { void setup(com.google.firebase.database.connection.idl.zzc,com.google.firebase.database.connection.idl.zzj,com.google.android.gms.dynamic.IObjectWrapper,com.google.firebase.database.connection.idl.zzv); }', but not the descriptor class 'com.google.android.gms.dynamic.IObjectWrapper'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zzs { void listen(java.util.List,com.google.android.gms.dynamic.IObjectWrapper,com.google.firebase.database.connection.idl.zzp,long,com.google.firebase.database.connection.idl.zzag); }', but not the descriptor class 'com.google.android.gms.dynamic.IObjectWrapper'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zzs { void unlisten(java.util.List,com.google.android.gms.dynamic.IObjectWrapper); }', but not the descriptor class 'com.google.android.gms.dynamic.IObjectWrapper'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zzs { void put(java.util.List,com.google.android.gms.dynamic.IObjectWrapper,com.google.firebase.database.connection.idl.zzag); }', but not the descriptor class 'com.google.android.gms.dynamic.IObjectWrapper'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zzs { void compareAndPut(java.util.List,com.google.android.gms.dynamic.IObjectWrapper,java.lang.String,com.google.firebase.database.connection.idl.zzag); }', but not the descriptor class 'com.google.android.gms.dynamic.IObjectWrapper'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zzs { void merge(java.util.List,com.google.android.gms.dynamic.IObjectWrapper,com.google.firebase.database.connection.idl.zzag); }', but not the descriptor class 'com.google.android.gms.dynamic.IObjectWrapper'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zzs { void onDisconnectPut(java.util.List,com.google.android.gms.dynamic.IObjectWrapper,com.google.firebase.database.connection.idl.zzag); }', but not the descriptor class 'com.google.android.gms.dynamic.IObjectWrapper'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zzs { void onDisconnectMerge(java.util.List,com.google.android.gms.dynamic.IObjectWrapper,com.google.firebase.database.connection.idl.zzag); }', but not the descriptor class 'com.google.android.gms.dynamic.IObjectWrapper'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zzu { void setup(com.google.firebase.database.connection.idl.zzc,com.google.firebase.database.connection.idl.zzj,com.google.android.gms.dynamic.IObjectWrapper,com.google.firebase.database.connection.idl.zzv); }', but not the descriptor class 'com.google.android.gms.dynamic.IObjectWrapper'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zzu { void listen(java.util.List,com.google.android.gms.dynamic.IObjectWrapper,com.google.firebase.database.connection.idl.zzp,long,com.google.firebase.database.connection.idl.zzag); }', but not the descriptor class 'com.google.android.gms.dynamic.IObjectWrapper'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zzu { void unlisten(java.util.List,com.google.android.gms.dynamic.IObjectWrapper); }', but not the descriptor class 'com.google.android.gms.dynamic.IObjectWrapper'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zzu { void put(java.util.List,com.google.android.gms.dynamic.IObjectWrapper,com.google.firebase.database.connection.idl.zzag); }', but not the descriptor class 'com.google.android.gms.dynamic.IObjectWrapper'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zzu { void compareAndPut(java.util.List,com.google.android.gms.dynamic.IObjectWrapper,java.lang.String,com.google.firebase.database.connection.idl.zzag); }', but not the descriptor class 'com.google.android.gms.dynamic.IObjectWrapper'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zzu { void merge(java.util.List,com.google.android.gms.dynamic.IObjectWrapper,com.google.firebase.database.connection.idl.zzag); }', but not the descriptor class 'com.google.android.gms.dynamic.IObjectWrapper'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zzu { void onDisconnectPut(java.util.List,com.google.android.gms.dynamic.IObjectWrapper,com.google.firebase.database.connection.idl.zzag); }', but not the descriptor class 'com.google.android.gms.dynamic.IObjectWrapper'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zzu { void onDisconnectMerge(java.util.List,com.google.android.gms.dynamic.IObjectWrapper,com.google.firebase.database.connection.idl.zzag); }', but not the descriptor class 'com.google.android.gms.dynamic.IObjectWrapper'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zzv { void zza(java.util.List,com.google.android.gms.dynamic.IObjectWrapper,boolean,long); }', but not the descriptor class 'com.google.android.gms.dynamic.IObjectWrapper'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zzv { void zza(java.util.List,java.util.List,com.google.android.gms.dynamic.IObjectWrapper,long); }', but not the descriptor class 'com.google.android.gms.dynamic.IObjectWrapper'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zzv { void zzN(com.google.android.gms.dynamic.IObjectWrapper); }', but not the descriptor class 'com.google.android.gms.dynamic.IObjectWrapper'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zzx { void zza(java.util.List,com.google.android.gms.dynamic.IObjectWrapper,boolean,long); }', but not the descriptor class 'com.google.android.gms.dynamic.IObjectWrapper'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zzx { void zza(java.util.List,java.util.List,com.google.android.gms.dynamic.IObjectWrapper,long); }', but not the descriptor class 'com.google.android.gms.dynamic.IObjectWrapper'
Note: the configuration keeps the entry point 'com.google.firebase.database.connection.idl.zzx { void zzN(com.google.android.gms.dynamic.IObjectWrapper); }', but not the descriptor class 'com.google.android.gms.dynamic.IObjectWrapper'
Note: the configuration keeps the entry point 'com.google.firebase.iid.FirebaseInstanceId { com.google.firebase.iid.FirebaseInstanceId getInstance(com.google.firebase.FirebaseApp); }', but not the descriptor class 'com.google.firebase.FirebaseApp'
Note: the configuration keeps the entry point 'com.google.firebase.messaging.zzc { void zza(com.google.android.gms.measurement.AppMeasurement,android.content.Context,java.lang.String,com.google.android.gms.internal.aee,com.google.firebase.messaging.zzb,int); }', but not the descriptor class 'com.google.android.gms.internal.aee'
Note: the configuration keeps the entry point 'com.google.firebase.messaging.zzc { java.lang.Object zza(com.google.android.gms.internal.aee,java.lang.String,com.google.firebase.messaging.zzb); }', but not the descriptor class 'com.google.android.gms.internal.aee'
Note: the configuration keeps the entry point 'com.google.firebase.messaging.zzc { android.os.Bundle zza(com.google.android.gms.internal.aee); }', but not the descriptor class 'com.google.android.gms.internal.aee'
Note: the configuration keeps the entry point 'com.google.firebase.messaging.zzc { java.lang.String zza(com.google.android.gms.internal.aee,com.google.firebase.messaging.zzb); }', but not the descriptor class 'com.google.android.gms.internal.aee'
Note: the configuration keeps the entry point 'com.twitter.sdk.android.core.identity.TwitterLoginButton { void setCallback(com.twitter.sdk.android.core.Callback); }', but not the descriptor class 'com.twitter.sdk.android.core.Callback'
Note: the configuration keeps the entry point 'com.twitter.sdk.android.core.services.MediaService { retrofit2.Call upload(okhttp3.RequestBody,okhttp3.RequestBody,okhttp3.RequestBody); }', but not the descriptor class 'okhttp3.RequestBody'
Note: the configuration keeps the entry point 'com.twitter.sdk.android.core.services.MediaService { retrofit2.Call upload(okhttp3.RequestBody,okhttp3.RequestBody,okhttp3.RequestBody); }', but not the descriptor class 'okhttp3.RequestBody'
Note: the configuration keeps the entry point 'com.twitter.sdk.android.core.services.MediaService { retrofit2.Call upload(okhttp3.RequestBody,okhttp3.RequestBody,okhttp3.RequestBody); }', but not the descriptor class 'okhttp3.RequestBody'
Note: the configuration keeps the entry point 'com.twitter.sdk.android.core.services.SearchService { retrofit2.Call tweets(java.lang.String,com.twitter.sdk.android.core.services.params.Geocode,java.lang.String,java.lang.String,java.lang.String,java.lang.Integer,java.lang.String,java.lang.Long,java.lang.Long,java.lang.Boolean); }', but not the descriptor class 'com.twitter.sdk.android.core.services.params.Geocode'
Note: there were 1 references to unknown classes.
      You should check your configuration for typos.
      (http://proguard.sourceforge.net/manual/troubleshooting.html#unknownclass)
Note: there were 122 unkept descriptor classes in kept class members.
      You should consider explicitly keeping the mentioned classes
      (using '-keep').
      (http://proguard.sourceforge.net/manual/troubleshooting.html#descriptorclass)
Note: there were 21 unresolved dynamic references to classes or interfaces.
      You should check if you need to specify additional program jars.
      (http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclass)
Note: there were 24 accesses to class members by means of introspection.
      You should consider explicitly keeping the mentioned class members
      (using '-keep' or '-keepclassmembers').
      (http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclassmember)

Warning: there were 26 unresolved references to classes or interfaces.
         You may need to add missing library jars or update their versions.
         If your code works fine without the missing classes, you can suppress
         the warnings with '-dontwarn' options.
         (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass) ***




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

-keepattributes *Annotation*
-dontwarn java.lang.invoke.*
-dontwarn **$$Lambda$*
-dontwarn com.google.android.exoplayer2.**
-dontwarn com.devbrackets.**
-dontwarn com.facebook.**
-dontwarn com.twitter.**
-dontwarn okhttp3.**
-dontwarn com.twitter.sdk.android.core.services.params.Geocode
-keep class com.google.firebase.messaging.** { *; }
-dontwarn com.google.android.gms.**
-keep class com.google.firebase.database.connection.** { *; }
-keep class com.example.gurtek.desireme.circlemenu.CircleMenu
-keep class com.example.gurtek.desireme.imagezoom.ImageViewTouchBase

【问题讨论】:

    标签: android proguard android-proguard


    【解决方案1】:

    我得到了解决方案,实际上我正在尝试解决笔记而不是控制台中的警告。在解决警告 apk 构建后就好了

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-12-20
      • 1970-01-01
      • 1970-01-01
      • 2019-07-14
      • 2016-12-15
      • 1970-01-01
      • 2020-12-09
      相关资源
      最近更新 更多