这是我的Proguard文件:
-dontoptimize -dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses -dontskipnonpubliclibraryclassmembers -dontpreverify -verbose -optimizations!code / simplifiedification / arithmetic,!field / ,! class / merge / -dump class_files.txt -printseeds seeds.txt -printusage unused.txt -printmapping mapping.txt -renamesourcefile属性SourceFile -keepattributes SourceFile,LineNumberTable -keepattributes Annotation ,EnclosingMethod -keepattributes签名 -ignorewarnings
-keepattributes Signature,RuntimeVisibleAnnotations,AnnotationDefault -keepclassmembers class * { @ com.google.api.client.util.Key; } -dontwarn sun.misc.Unsafe -dontwarn com.google.common.collect.MinMaxPriorityQueue -dontwarn com.google.api.client.extensions.android。** -dontwarn com.google.api.client.googleapis.extensions.android。**
-keep @interface com.google.gson.annotations.SerializedName -keepattributes Annotation
-keep class com.google.inject。** {*; } -keep class javax.inject。** {*; } -keep class javax.annotation。** {*; }
-keep public class Pokoto。** { public void set *( *); 公共 获取(); }
-keep class com.firebase。** {*; } -dontwarn com.fasterxml。**
-dontnote io.presage。** -dontwarn shared_presage。** -dontwarn org.codehaus。**
-keepattributes签名
-keep class shared_presage。** {*; } -keep class io.presage。** {*; } -keepclassmembers class io.presage。** { *; }
-keepattributes Annotation -keepattributes JavascriptInterface -keepclassmembers class * { @ android.webkit.JavascriptInterface; }
-dontnote okhttp3。** -dontnote okio。** -dontwarn okhttp3。** -dontwarn okio。**
-dontnote sun.misc.Unsafe -dontnote android.net.http。*
-dontnote org.apache.commons.codec。** -dontnote org.apache.http。**
-dontwarn org.apache.commons.collections.BeanMap -dontwarn java.beans。**
-dontnote com.google.gson。** -dontnote com.google.android.gms.ads。** -dontnote com.google.android。** -dontnote com.google.ads。**
-keepclassmembers class * implements java.io.Serializable { static final long serialVersionUID; private static final java.io.ObjectStreamField [] serialPersistentFields; private void writeObject(java.io.ObjectOutputStream); private void readObject(java.io.ObjectInputStream); java.lang.Object writeReplace(); java.lang.Object readResolve(); }
-dontwarn com.amazon。**
-keep class com.amazon。** {*;}
-keepattributes Annotation
-keep public class com.google.android.youtube.player。** {*; }
-keep class net.sqlcipher。** {; } -keep class net.sqlcipher.database。 {*; }
-keep class com.crashlytics。** {*; } -dontwarn com.crashlytics。**
-keepclassmembers class com.mopub。** {public *; } -keep public class com.mopub。** -keep public class android.webkit.JavascriptInterface {} -keep class * extends com.mopub.mobileads.CustomEventBanner {} -keepclassmembers类com.mopub.mobileads.CustomEventBannerAdapter {!private!public!protected *;} -keep class * extends com.mopub.mobileads.CustomEventInterstitial {} -keep class * extends com.mopub.mobileads.CustomEventNative {} -keep class com.google.android.gms.common.GooglePlayServicesUtil {;} -keep class com.google.android.gms.ads.identifier.AdvertisingIdClient {;} -keep class com.google.android.gms.ads.identifier.AdvertisingIdClient $ Info {*;}
-keep public class *实现了com.bumptech.glide.module.GlideModule -keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser $ ** { ** [] $ VALUES; 上市 *; }
-keepattributes签名 -keepattributes Annotation -keep class okhttp3。** {*; } -keep interface okhttp3。** {*; } -dontwarn okhttp3。 -dontwarn okio。**
-keepattributes签名
-keepattributes Annotation
-keep class sun.misc.Unsafe {*; } -keep class com.google.gson.stream。** {*; }
-keep class com.google.gson.examples.android.model。** {*; }
-keep class *实现了com.google.gson.TypeAdapterFactory -keep class *实现了com.google.gson.JsonSerializer -keep class *实现com.google.gson.JsonDeserializer
-keep public class com.google.gson
-keep class com.google.common.io.Resources { 公共静态; } -keep class com.google.common.collect.Lists { public static ** reverse(**); } -keep class com.google.common.base.Charsets { 公共静态; }
-keep class com.google.common.base.Joiner { public static Joiner on(String); 公共**加入(...); }
-keep class com.google.common.collect.MapMakerInternalMap $ ReferenceEntry -keep class com.google.common.cache.LocalCache $ ReferenceEntry
-dontwarn sun.misc.Unsafe -dontwarn javax.annotation。**
-keep class com.google.j2objc.annotations。** {*; } -dontwarn com.google.j2objc.annotations。** -keep class java.lang.ClassValue {*; } -dontwarn java.lang.ClassValue -keep class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement {*; } -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
-dontwarn com.google.errorprone.annotations.CanIgnoreReturnValue -dontwarn com.google.errorprone.annotations.concurrent.LazyInit -dontwarn com.google.errorprone.annotations.ForOverride
-keep class * extends java.util.ListResourceBundle { protected Object [] [] getContents(); }
-keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable { public static final *** NULL; }
-keepnames @ com.google.android.gms.common.annotation.KeepName class * -keepclassmembernames class * { @ com.google.android.gms.common.annotation.KeepName *; }
-keepnames class *实现android.os.Parcelable { public static final ** CREATOR; }
-dontwarn javax.annotation。** -dontwarn javax.inject。** -dontwarn sun.misc.Unsafe -keep class com.google.android.gms。** {*; } -dontwarn com.google.android.gms。** -keep class android.webkit.WebSettings -dontwarn android.webkit.WebSettings -keep class android.content.pm.PackageInstaller -keep class android.content.pm.PackageInstaller $ SessionInfo -keep class android.content.pm.PackageManager -dontwarn android.content.pm.PackageInstaller -dontwarn android.content.pm.PackageInstaller $ SessionInfo -dontwarn android.content.pm.PackageManager
-keep class android.support.v7.app。** {*; } -keep class android.support.v4.app。** {*; } -keep interface android.support.v4.app。** {*; }
-keep class com.facebook。** { *; }
-keep public class * extends android.app.Activity -keep public class *扩展android.app.Application -keep public class *扩展android.app.Service -keep public class *扩展了android.content.BroadcastReceiver -keep public class *扩展了android.content.ContentProvider -keep public class * extends android.app.backup.BackupAgentHelper -keep public class * extends android.preference.Preference
-keep public class *扩展了android.view.View -keep public class * extends android.support.v4。** -keep public class * extends android.app.Fragment
-keep public class custom.components。**
-keepclasseswithmembernames class * { 原生的 }
-assumenosideeffects class android.util.Log { public static * d(...); public static * v(...); }
-keep public class * extends android.view.View { public(android.content.Context); public(android.content.Context,android.util.AttributeSet); public(android.content.Context,android.util.AttributeSet,int); public void set *(...); }
-keepclasseswithmembers class * { public(android.content.Context,android.util.AttributeSet); }
-keepclasseswithmembers class * { public(android.content.Context,android.util.AttributeSet,int); }
-keep class *实现android.os.Parcelable { public static final android.os.Parcelable $ Creator *; }
-keepclassmembers枚举* { public static ** [] values(); public static ** valueOf(java.lang.String); }
-keep class *实现android.os.Parcelable { public static final android.os.Parcelable $ Creator *; }
-keepclassmembers class **。R $ * { 公共静态; }
-keep public class * { 公共保护*; }
这是我得到的错误: 警告:处理任务java.io.IOException时出现异常:无法写入[C:\ Users \ Anish \ pokoto \ app \ build \ intermediates \ transforms \ proguard \ release \ jars \ 3 \ 1f \ main.jar] (无法读取[C:\ Users \ Anish.android \ build-cache \ 9a4d2c08e132f2da417ab6ffc3ca37865ea16fd6 \ output \ jars \ classes.jar(;;;;;; ** .class)](重复的zip条目[类别。罐子:COM /谷歌/普通/碱/ FinalizableReference.class])) 错误:任务执行失败':app:transformClassesAndResourcesWithProguardForRelease'。
作业失败,请参阅日志了解详情
答案 0 :(得分:0)
我有类似的错误。 2017年6月15日更新 将Google Repository更新为版本54并使用播放服务的最新版本(11.0.1)而不是11.0.0
compile 'com.google.android.gms:play-services-identity:11.0.1'
compile 'com.google.android.gms:play-services-gcm:11.0.1'
compile 'com.google.android.gms:play-services-location:11.0.1'
compile 'com.google.android.gms:play-services-analytics:11.0.1'
然后签名APK将毫无问题地生成。
请注意。 无需评论,因为它需要firebase
apply plugin: 'com.google.gms.google-services'