minifyEnabled为true后无法生成apk

时间:2017-08-21 13:20:54

标签: android proguard android-proguard

我想降低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

1 个答案:

答案 0 :(得分:0)

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