在我正在获得的项目上启用proguard时
dexing文件时出现异常:翻译已中断
不幸的是我不明白为什么 这是完整的输出 - 如果有人提示这是什么请告诉我:
:android:transformClassesAndResourcesWithProguardForNoMapsNoAnalyticsForFDroidRelease
ProGuard, version 5.2.1
Reading program jar [/home/ligi/git/PassbookForAndroid/android/libs/zxing-core-2.3.0-SNAPSHOT.jar] (filtered)
Reading program jar [/home/ligi/bin/android-sdk/extras/android/m2repository/com/android/support/support-annotations/23.1.1/support-annotations-23.1.1.jar] (filtered)
Reading program jar [/home/ligi/.gradle/caches/modules-2/files-2.1/com.google.dagger/dagger/2.0.2/de8416eda7b2fd7c25836b140c39e1cbf10542f6/dagger-2.0.2.jar] (filtered)
Reading program jar [/home/ligi/.gradle/caches/modules-2/files-2.1/javax.inject/javax.inject/1/6975da39a7040257bd51d21a231b76c915872d38/javax.inject-1.jar] (filtered)
Reading program jar [/home/ligi/.gradle/caches/modules-2/files-2.1/org.ligi/tracedroid/1.4/7e122fba2126b2a6043826f887e91f2c350c041f/tracedroid-1.4.jar] (filtered)
Reading program jar [/home/ligi/.gradle/caches/modules-2/files-2.1/joda-time/joda-time/2.9.1/e1908f47e7fd11b291dbc8368223db7b4d516b30/joda-time-2.9.1-no-tzdb.jar] (filtered)
Reading program jar [/home/ligi/.gradle/caches/modules-2/files-2.1/com.squareup/otto/1.3.8/cf615176cd1177edf71d3c9605f8dc148fede6be/otto-1.3.8.jar] (filtered)
Reading program jar [/home/ligi/.gradle/caches/modules-2/files-2.1/com.squareup.okio/okio/1.6.0/98476622f10715998eacf9240d6b479f12c66143/okio-1.6.0.jar] (filtered)
Reading program jar [/home/ligi/.gradle/caches/modules-2/files-2.1/com.jakewharton/butterknife/7.0.1/d5d13ea991eab0252e3710e5df3d6a9d4b21d461/butterknife-7.0.1.jar] (filtered)
Reading program jar [/home/ligi/.gradle/caches/modules-2/files-2.1/com.google.code.findbugs/jsr305/3.0.1/f7be08ec23c21485b9b5a1cf1654c2ec8c58168d/jsr305-3.0.1.jar] (filtered)
Reading program jar [/home/ligi/.gradle/caches/modules-2/files-2.1/com.squareup.okhttp/okhttp/2.7.2/20f6463eb19ac61960c5d91a094c2f4f0727dc2e/okhttp-2.7.2.jar] (filtered)
Reading program jar [/home/ligi/.gradle/caches/modules-2/files-2.1/net.lingala.zip4j/zip4j/1.3.2/4ba84e98ee017b74cb52f45962f929a221f3074c/zip4j-1.3.2.jar] (filtered)
Reading program jar [/home/ligi/.gradle/caches/modules-2/files-2.1/com.nineoldandroids/library/2.4.0/e9b63380f3a242dbdbf103a2355ad7e43bad17cb/library-2.4.0.jar] (filtered)
Reading program jar [/home/ligi/git/PassbookForAndroid/android/build/intermediates/exploded-aar/net.danlew/android.joda/2.9.1/jars/classes.jar] (filtered)
Reading program jar [/home/ligi/git/PassbookForAndroid/android/build/intermediates/exploded-aar/com.android.support/cardview-v7/23.1.1/jars/classes.jar] (filtered)
Reading program jar [/home/ligi/git/PassbookForAndroid/android/build/intermediates/exploded-aar/net.i2p.android.ext/floatingactionbutton/1.10.0/jars/classes.jar] (filtered)
Reading program jar [/home/ligi/git/PassbookForAndroid/android/build/intermediates/exploded-aar/org.ligi/AXT/0.35/jars/classes.jar] (filtered)
Reading program jar [/home/ligi/git/PassbookForAndroid/android/build/intermediates/exploded-aar/org.ligi/snackengage/0.4/jars/classes.jar] (filtered)
Reading program jar [/home/ligi/git/PassbookForAndroid/android/build/intermediates/exploded-aar/com.android.support/design/23.1.1/jars/classes.jar] (filtered)
Reading program jar [/home/ligi/git/PassbookForAndroid/android/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.1/jars/classes.jar] (filtered)
Reading program jar [/home/ligi/git/PassbookForAndroid/android/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.1.1/jars/classes.jar] (filtered)
Reading program jar [/home/ligi/git/PassbookForAndroid/android/build/intermediates/exploded-aar/com.android.support/support-v4/23.1.1/jars/classes.jar] (filtered)
Reading program jar [/home/ligi/git/PassbookForAndroid/android/build/intermediates/exploded-aar/com.android.support/support-v4/23.1.1/jars/libs/internal_impl-23.1.1.jar] (filtered)
Reading program jar [/home/ligi/git/PassbookForAndroid/android/build/intermediates/exploded-aar/com.larswerkman/HoloColorPicker/1.5/jars/classes.jar] (filtered)
Reading program jar [/home/ligi/git/PassbookForAndroid/android/build/intermediates/exploded-aar/net.steamcrafted/load-toast/1.0.9/jars/classes.jar] (filtered)
Reading program jar [/home/ligi/git/PassbookForAndroid/android/build/intermediates/exploded-aar/com.squareup.leakcanary/leakcanary-android-no-op/1.3.1/jars/classes.jar] (filtered)
Reading program jar [/home/ligi/git/PassbookForAndroid/android/build/intermediates/transforms/mergeJavaRes/noMapsNoAnalyticsForFDroid/release/jars/2/1f/main.jar] (filtered)
Reading program directory [/home/ligi/git/PassbookForAndroid/android/build/intermediates/classes/noMapsNoAnalyticsForFDroid/release] (filtered)
Reading library jar [/home/ligi/.gradle/caches/modules-2/files-2.1/org.projectlombok/lombok/1.16.6/9d3a47307466b28632bf35f8972ae9d703879416/lombok-1.16.6.jar] (filtered)
Reading library jar [/home/ligi/.gradle/caches/modules-2/files-2.1/org.glassfish/javax.annotation/10.0-b28/30eb3b3cc9cb0863a4edaea5a7575f8ace1b96ba/javax.annotation-10.0-b28.jar] (filtered)
Reading library jar [/home/ligi/bin/android-sdk/platforms/android-23/android.jar]
Reading library jar [/home/ligi/bin/android-sdk/platforms/android-23/optional/org.apache.http.legacy.jar]
Note: duplicate definition of library class [android.net.http.SslError]
Note: duplicate definition of library class [android.net.http.SslCertificate]
Note: duplicate definition of library class [android.net.http.SslCertificate$DName]
Note: duplicate definition of library class [org.apache.http.conn.scheme.HostNameResolver]
Note: duplicate definition of library class [org.apache.http.conn.scheme.SocketFactory]
Note: duplicate definition of library class [org.apache.http.conn.ConnectTimeoutException]
Note: duplicate definition of library class [org.apache.http.params.HttpParams]
Note: there were 7 duplicate class definitions.
(http://proguard.sourceforge.net/manual/troubleshooting.html#duplicateclass)
Note: the configuration refers to the unknown class 'fqcn.of.javascript.interface.for.webview'
Note: the configuration refers to the unknown class 'com.google.api.client.util.Key'
Maybe you meant the fully qualified name 'java.security.Key'?
Note: android.support.v4.text.ICUCompatApi23: can't find dynamically referenced class libcore.icu.ICU
Note: android.support.v4.text.ICUCompatIcs: can't find dynamically referenced class libcore.icu.ICU
Note: android.support.v7.widget.DrawableUtils: can't find dynamically referenced class android.graphics.Insets
Note: com.squareup.okhttp.internal.Platform: can't find dynamically referenced class com.android.org.conscrypt.OpenSSLSocketImpl
Note: com.squareup.okhttp.internal.Platform: can't find dynamically referenced class org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl
Note: org.joda.time.DateTimeZone calls '(org.joda.time.tz.Provider)Class.forName(variable).newInstance()'
Note: org.joda.time.DateTimeZone calls '(org.joda.time.tz.NameProvider)Class.forName(variable).newInstance()'
Note: android.support.v4.text.ICUCompatApi23 accesses a method 'addLikelySubtags(java.util.Locale)' dynamically
Maybe this is program method 'android.support.v4.text.ICUCompatIcs { java.lang.String addLikelySubtags(java.util.Locale); }'
Note: android.support.v4.text.ICUCompatIcs accesses a method 'addLikelySubtags(java.lang.String)' dynamically
Note: android.support.v7.widget.ViewUtils accesses a method 'makeOptionalFitsSystemWindows()' dynamically
Note: butterknife.internal.ButterKnifeProcessor accesses a declared method 'value()' dynamically
Maybe this is program method 'android.support.annotation.IntDef { long[] value(); }'
Maybe this is program method 'android.support.annotation.RequiresPermission { java.lang.String value(); }'
Maybe this is program method 'android.support.annotation.RequiresPermission$Read { android.support.annotation.RequiresPermission value(); }'
Maybe this is program method 'android.support.annotation.RequiresPermission$Write { android.support.annotation.RequiresPermission value(); }'
Maybe this is program method 'android.support.annotation.Size { long value(); }'
Maybe this is program method 'android.support.annotation.StringDef { java.lang.String[] value(); }'
Maybe this is program method 'android.support.design.widget.CoordinatorLayout$DefaultBehavior { java.lang.Class value(); }'
Maybe this is program method 'butterknife.Bind { int[] value(); }'
Maybe this is program method 'butterknife.BindBool { int value(); }'
Maybe this is program method 'butterknife.BindColor { int value(); }'
Maybe this is program method 'butterknife.BindDimen { int value(); }'
Maybe this is program method 'butterknife.BindDrawable { int value(); }'
Maybe this is program method 'butterknife.BindInt { int value(); }'
Maybe this is program method 'butterknife.BindString { int value(); }'
Maybe this is program method 'butterknife.OnCheckedChanged { int[] value(); }'
Maybe this is program method 'butterknife.OnClick { int[] value(); }'
Maybe this is program method 'butterknife.OnEditorAction { int[] value(); }'
Maybe this is program method 'butterknife.OnFocusChange { int[] value(); }'
Maybe this is program method 'butterknife.OnItemClick { int[] value(); }'
Maybe this is program method 'butterknife.OnItemLongClick { int[] value(); }'
Maybe this is program method 'butterknife.OnItemSelected { int[] value(); }'
Maybe this is program method 'butterknife.OnLongClick { int[] value(); }'
Maybe this is program method 'butterknife.OnPageChange { int[] value(); }'
Maybe this is program method 'butterknife.OnTextChanged { int[] value(); }'
Maybe this is program method 'butterknife.OnTouch { int[] value(); }'
Maybe this is program method 'javax.annotation.MatchesPattern { java.lang.String value(); }'
Maybe this is program method 'javax.annotation.Syntax { java.lang.String value(); }'
Maybe this is program method 'javax.annotation.concurrent.GuardedBy { java.lang.String value(); }'
Maybe this is program method 'javax.annotation.meta.TypeQualifierDefault { java.lang.annotation.ElementType[] value(); }'
Maybe this is program method 'javax.inject.Named { java.lang.String value(); }'
Maybe this is library method 'android.annotation.SuppressLint { java.lang.String[] value(); }'
Maybe this is library method 'android.annotation.TargetApi { int value(); }'
Maybe this is library method 'dalvik.annotation.TestTargetClass { java.lang.Class value(); }'
Maybe this is library method 'java.lang.SuppressWarnings { java.lang.String[] value(); }'
Maybe this is library method 'java.lang.annotation.Retention { java.lang.annotation.RetentionPolicy value(); }'
Maybe this is library method 'java.lang.annotation.Target { java.lang.annotation.ElementType[] value(); }'
Maybe this is library method 'javax.annotation.Generated { java.lang.String[] value(); }'
Maybe this is library method 'javax.annotation.Resources { javax.annotation.Resource[] value(); }'
Maybe this is library method 'javax.annotation.security.DeclareRoles { java.lang.String[] value(); }'
Maybe this is library method 'javax.annotation.security.RolesAllowed { java.lang.String[] value(); }'
Maybe this is library method 'javax.annotation.security.RunAs { java.lang.String value(); }'
Maybe this is library method 'lombok.Cleanup { java.lang.String value(); }'
Maybe this is library method 'lombok.Getter { lombok.AccessLevel value(); }'
Maybe this is library method 'lombok.Setter { lombok.AccessLevel value(); }'
Maybe this is library method 'lombok.Singular { java.lang.String value(); }'
Maybe this is library method 'lombok.SneakyThrows { java.lang.Class[] value(); }'
Maybe this is library method 'lombok.Synchronized { java.lang.String value(); }'
Maybe this is library method 'lombok.experimental.ExtensionMethod { java.lang.Class[] value(); }'
Maybe this is library method 'lombok.experimental.Wither { lombok.AccessLevel value(); }'
Note: butterknife.internal.ButterKnifeProcessor accesses a declared method 'callback()' dynamically
Maybe this is program method 'butterknife.OnItemSelected { butterknife.OnItemSelected$Callback callback(); }'
Maybe this is program method 'butterknife.OnPageChange { butterknife.OnPageChange$Callback callback(); }'
Maybe this is program method 'butterknife.OnTextChanged { butterknife.OnTextChanged$Callback callback(); }'
Note: com.squareup.okhttp.internal.Platform accesses a method 'tagSocket(java.net.Socket)' dynamically
Maybe this is program method 'android.support.v4.net.TrafficStatsCompat { void tagSocket(java.net.Socket); }'
Maybe this is program method 'android.support.v4.net.TrafficStatsCompat$BaseTrafficStatsCompatImpl { void tagSocket(java.net.Socket); }'
Maybe this is program method 'android.support.v4.net.TrafficStatsCompat$IcsTrafficStatsCompatImpl { void tagSocket(java.net.Socket); }'
Maybe this is program method 'android.support.v4.net.TrafficStatsCompat$TrafficStatsCompatImpl { void tagSocket(java.net.Socket); }'
Maybe this is program method 'android.support.v4.net.TrafficStatsCompatIcs { void tagSocket(java.net.Socket); }'
Maybe this is program method 'com.squareup.okhttp.internal.Platform { void tagSocket(java.net.Socket); }'
Maybe this is program method 'com.squareup.okhttp.internal.Platform$Android { void tagSocket(java.net.Socket); }'
Maybe this is library method 'android.net.TrafficStats { void tagSocket(java.net.Socket); }'
Note: com.squareup.okhttp.internal.Platform accesses a method 'untagSocket(java.net.Socket)' dynamically
Maybe this is program method 'android.support.v4.net.TrafficStatsCompat { void untagSocket(java.net.Socket); }'
Maybe this is program method 'android.support.v4.net.TrafficStatsCompat$BaseTrafficStatsCompatImpl { void untagSocket(java.net.Socket); }'
Maybe this is program method 'android.support.v4.net.TrafficStatsCompat$IcsTrafficStatsCompatImpl { void untagSocket(java.net.Socket); }'
Maybe this is program method 'android.support.v4.net.TrafficStatsCompat$TrafficStatsCompatImpl { void untagSocket(java.net.Socket); }'
Maybe this is program method 'android.support.v4.net.TrafficStatsCompatIcs { void untagSocket(java.net.Socket); }'
Maybe this is program method 'com.squareup.okhttp.internal.Platform { void untagSocket(java.net.Socket); }'
Maybe this is program method 'com.squareup.okhttp.internal.Platform$Android { void untagSocket(java.net.Socket); }'
Maybe this is library method 'android.net.TrafficStats { void untagSocket(java.net.Socket); }'
Note: com.squareup.okhttp.internal.Platform accesses a method 'remove(javax.net.ssl.SSLSocket)' dynamically
Note: the configuration keeps the entry point 'android.support.design.internal.NavigationMenuPresenter$1 { NavigationMenuPresenter$1(android.support.design.internal.NavigationMenuPresenter); }', but not the descriptor class 'android.support.design.internal.NavigationMenuPresenter'
Note: the configuration keeps the entry point 'android.support.design.internal.NavigationMenuPresenter$NavigationMenuAdapter { NavigationMenuPresenter$NavigationMenuAdapter(android.support.design.internal.NavigationMenuPresenter); }', but not the descriptor class 'android.support.design.internal.NavigationMenuPresenter'
Note: there were 2 references to unknown classes.
You should check your configuration for typos.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unknownclass)
Note: there were 2 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 5 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 2 class casts of dynamically created class instances.
You might consider explicitly keeping the mentioned classes and/or
their implementations (using '-keep').
(http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclasscast)
Note: there were 8 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)
Preparing output jar [/home/ligi/git/PassbookForAndroid/android/build/intermediates/transforms/proguard/noMapsNoAnalyticsForFDroid/release/jars/3/1f/main.jar]
Copying resources from program jar [/home/ligi/git/PassbookForAndroid/android/libs/zxing-core-2.3.0-SNAPSHOT.jar] (filtered)
Copying resources from program jar [/home/ligi/bin/android-sdk/extras/android/m2repository/com/android/support/support-annotations/23.1.1/support-annotations-23.1.1.jar] (filtered)
Copying resources from program jar [/home/ligi/.gradle/caches/modules-2/files-2.1/com.google.dagger/dagger/2.0.2/de8416eda7b2fd7c25836b140c39e1cbf10542f6/dagger-2.0.2.jar] (filtered)
Copying resources from program jar [/home/ligi/.gradle/caches/modules-2/files-2.1/javax.inject/javax.inject/1/6975da39a7040257bd51d21a231b76c915872d38/javax.inject-1.jar] (filtered)
Copying resources from program jar [/home/ligi/.gradle/caches/modules-2/files-2.1/org.ligi/tracedroid/1.4/7e122fba2126b2a6043826f887e91f2c350c041f/tracedroid-1.4.jar] (filtered)
Copying resources from program jar [/home/ligi/.gradle/caches/modules-2/files-2.1/joda-time/joda-time/2.9.1/e1908f47e7fd11b291dbc8368223db7b4d516b30/joda-time-2.9.1-no-tzdb.jar] (filtered)
Copying resources from program jar [/home/ligi/.gradle/caches/modules-2/files-2.1/com.squareup/otto/1.3.8/cf615176cd1177edf71d3c9605f8dc148fede6be/otto-1.3.8.jar] (filtered)
Copying resources from program jar [/home/ligi/.gradle/caches/modules-2/files-2.1/com.squareup.okio/okio/1.6.0/98476622f10715998eacf9240d6b479f12c66143/okio-1.6.0.jar] (filtered)
Copying resources from program jar [/home/ligi/.gradle/caches/modules-2/files-2.1/com.jakewharton/butterknife/7.0.1/d5d13ea991eab0252e3710e5df3d6a9d4b21d461/butterknife-7.0.1.jar] (filtered)
Copying resources from program jar [/home/ligi/.gradle/caches/modules-2/files-2.1/com.google.code.findbugs/jsr305/3.0.1/f7be08ec23c21485b9b5a1cf1654c2ec8c58168d/jsr305-3.0.1.jar] (filtered)
Copying resources from program jar [/home/ligi/.gradle/caches/modules-2/files-2.1/com.squareup.okhttp/okhttp/2.7.2/20f6463eb19ac61960c5d91a094c2f4f0727dc2e/okhttp-2.7.2.jar] (filtered)
Copying resources from program jar [/home/ligi/.gradle/caches/modules-2/files-2.1/net.lingala.zip4j/zip4j/1.3.2/4ba84e98ee017b74cb52f45962f929a221f3074c/zip4j-1.3.2.jar] (filtered)
Copying resources from program jar [/home/ligi/.gradle/caches/modules-2/files-2.1/com.nineoldandroids/library/2.4.0/e9b63380f3a242dbdbf103a2355ad7e43bad17cb/library-2.4.0.jar] (filtered)
Copying resources from program jar [/home/ligi/git/PassbookForAndroid/android/build/intermediates/exploded-aar/net.danlew/android.joda/2.9.1/jars/classes.jar] (filtered)
Copying resources from program jar [/home/ligi/git/PassbookForAndroid/android/build/intermediates/exploded-aar/com.android.support/cardview-v7/23.1.1/jars/classes.jar] (filtered)
Copying resources from program jar [/home/ligi/git/PassbookForAndroid/android/build/intermediates/exploded-aar/net.i2p.android.ext/floatingactionbutton/1.10.0/jars/classes.jar] (filtered)
Copying resources from program jar [/home/ligi/git/PassbookForAndroid/android/build/intermediates/exploded-aar/org.ligi/AXT/0.35/jars/classes.jar] (filtered)
Copying resources from program jar [/home/ligi/git/PassbookForAndroid/android/build/intermediates/exploded-aar/org.ligi/snackengage/0.4/jars/classes.jar] (filtered)
Copying resources from program jar [/home/ligi/git/PassbookForAndroid/android/build/intermediates/exploded-aar/com.android.support/design/23.1.1/jars/classes.jar] (filtered)
Copying resources from program jar [/home/ligi/git/PassbookForAndroid/android/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.1/jars/classes.jar] (filtered)
Copying resources from program jar [/home/ligi/git/PassbookForAndroid/android/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.1.1/jars/classes.jar] (filtered)
Copying resources from program jar [/home/ligi/git/PassbookForAndroid/android/build/intermediates/exploded-aar/com.android.support/support-v4/23.1.1/jars/classes.jar] (filtered)
Copying resources from program jar [/home/ligi/git/PassbookForAndroid/android/build/intermediates/exploded-aar/com.android.support/support-v4/23.1.1/jars/libs/internal_impl-23.1.1.jar] (filtered)
Copying resources from program jar [/home/ligi/git/PassbookForAndroid/android/build/intermediates/exploded-aar/com.larswerkman/HoloColorPicker/1.5/jars/classes.jar] (filtered)
Copying resources from program jar [/home/ligi/git/PassbookForAndroid/android/build/intermediates/exploded-aar/net.steamcrafted/load-toast/1.0.9/jars/classes.jar] (filtered)
Copying resources from program jar [/home/ligi/git/PassbookForAndroid/android/build/intermediates/exploded-aar/com.squareup.leakcanary/leakcanary-android-no-op/1.3.1/jars/classes.jar] (filtered)
Copying resources from program jar [/home/ligi/git/PassbookForAndroid/android/build/intermediates/transforms/mergeJavaRes/noMapsNoAnalyticsForFDroid/release/jars/2/1f/main.jar] (filtered)
Copying resources from program directory [/home/ligi/git/PassbookForAndroid/android/build/intermediates/classes/noMapsNoAnalyticsForFDroid/release] (filtered)
:android:transformClassesWithDexForNoMapsNoAnalyticsForFDroidRelease
Exception while dexing files: Translation has been interrupted
:android:transformClassesWithDexForNoMapsNoAnalyticsForFDroidRelease FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':android:transformClassesWithDexForNoMapsNoAnalyticsForFDroidRelease'.
> Translation has been interrupted
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 2 mins 6.152 secs
这里的proguard配置:
#http://stackoverflow.com/questions/19274974/android-badparcelableexception-only-with-signed-apk
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
-keepclassmembers class fqcn.of.javascript.interface.for.webview {
public *;
}
# optimize
-optimizationpasses 2
-optimizations !code/simplification/arithmetic
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
# AppCompat
-dontwarn android.support.v7.**
-keep class android.support.v7.** { *; }
-keep interface android.support.v7.** { *; }
# Keep line numbers to alleviate debugging stack traces
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable
### for api client
-keepattributes Signature,RuntimeVisibleAnnotations,AnnotationDefault
-keepclassmembers class * {
@com.google.api.client.util.Key <fields>;
}
# Needed by Guava
# See https://groups.google.com/forum/#!topic/guava-discuss/YCZzeCiIVoI
-dontwarn sun.misc.Unsafe
-dontwarn com.google.common.collect.MinMaxPriorityQueue
# Needed by google-http-client-android when linking against an older platform version
-dontwarn com.google.api.client.extensions.android.**
# Needed by google-api-client-android when linking against an older platform version
-dontwarn com.google.api.client.googleapis.extensions.android.**
#### for butterknife
-keep class butterknife.** { *; }
-dontwarn butterknife.internal.**
-keep class **$$ViewBinder { *; }
-keepclasseswithmembernames class * {
@butterknife.* <fields>;
}
-keepclasseswithmembernames class * {
@butterknife.* <methods>;
}
#### for support 22
-dontwarn android.support.**
# Fix bug on Samsung, Wiko (and other) devices running Android 4.2
# See also: https://code.google.com/p/android/issues/detail?id=78377
-keepattributes **
-keep class !android.support.v7.view.menu.**,!android.support.design.internal.NavigationMenu,!android.support.design.internal.NavigationMenuPresenter,!android.support.design.internal.NavigationSubMenu,** {*;}
# See: https://stackoverflow.com/questions/30562330/using-appcompat-layout-behavior-with-string-appbar-scrolling-view-behavior
-keep class android.support.design.widget.** { *; }
-keep interface android.support.design.widget.** { *; }
-dontwarn android.support.design.**
# lombok
-dontwarn javax.**
-dontwarn lombok.**
-dontwarn org.apache.**
-dontwarn com.squareup.**
-dontwarn com.sun.**
-dontwarn **retrofit**
-dontwarn okio.**
答案 0 :(得分:2)
由于重复的类条目,progurad失败。 有7个重复的类定义 根据proguard文件。 来源:http://proguard.sourceforge.net/manual/troubleshooting.html#duplicateclass。
注意: - 您的问题是由于重复输入造成的。
1.将您的jar文件移动到单个文件夹,例如
通过将第三方库移动到另一个目录(在我的情况下为“lib”)来解决此问题。然后添加
-injars libs
到proguard.cfg文件。 libs是包含第三方所有jar文件的文件夹。
2.在配置文件下添加。
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/yesidlazaro/Library/Android/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
-keepclassmembers class ** {
public void onEvent*(**);
}
# Keep GSON stuff
-keep class sun.misc.Unsafe { *; }
-keep class com.google.gson.** { *; }
# Keep Jackson stuff
-keep class org.codehaus.** { *; }
-keep class com.fasterxml.jackson.annotation.** { *; }
# Keep these for GSON and Jackson
-keepattributes Signature
-keepattributes *Annotation*
-keepattributes EnclosingMethod
# Keep the pojos used by GSON or Jackson
-keep class com.twnel.android.models.retrofit.** { *; }
# Keep Retrofit
-keep class retrofit.** { *; }
-keepclasseswithmembers class * {
@retrofit.** *;
}
-keepclassmembers class * {
@retrofit.** *;
}
# Keep Picasso
-keep class com.squareup.picasso.** { *; }
-keepclasseswithmembers class * {
@com.squareup.picasso.** *;
}
-keepclassmembers class * {
@com.squareup.picasso.** *;
}
# OkHttp
-keepattributes Signature
-keepattributes *Annotation*
-keep class com.squareup.okhttp.** { *; }
-keep interface com.squareup.okhttp.** { *; }
-dontwarn com.squareup.okhttp.**
# Butterknife
-keep class butterknife.** { *; }
-dontwarn butterknife.internal.**
-keep class **$$ViewBinder { *; }
-keepclasseswithmembernames class * {
@butterknife.* <fields>;
}
-keepclasseswithmembernames class * {
@butterknife.* <methods>;
}
#fix Proguard exception for some samsung devices
-keep class !android.support.v7.internal.view.menu.**,** {*;}
#craslytics
-keep class com.crashlytics.** { *; }
-dontwarn com.crashlytics.**
#amazon sdk
-keep class org.apache.commons.logging.** { *; }
-keep class com.amazonaws.services.sqs.QueueUrlHandler { *; }
-keep class com.amazonaws.javax.xml.transform.sax.* { public *; }
-keep class com.amazonaws.javax.xml.stream.** { *; }
-keep class com.amazonaws.services.**.model.*Exception* { *; }
-keep class org.codehaus.** { *; }
-keepattributes Signature,*Annotation*
-dontwarn javax.xml.stream.events.**
-dontwarn org.codehaus.jackson.**
-dontwarn org.apache.commons.logging.impl.**
-dontwarn org.apache.http.conn.scheme.**
-keep public class com.amazonaws.** { *; }
-keep public class com.fasterxml.jackson.core.** { *; }
# This dnsjava class uses old Sun API
-dontnote org.xbill.DNS.spi.DNSJavaNameServiceDescriptor
-dontwarn org.xbill.DNS.spi.DNSJavaNameServiceDescriptor
#more for squere libs
-dontwarn rx.**
-dontwarn okio.**
-dontwarn com.squareup.okhttp.*
-dontwarn retrofit.appengine.UrlFetchClient
-dontwarn com.fasterxml.**
-dontwarn com.googlecode.mp4parser.**
有关详细信息,请暂停此More confugration
答案 1 :(得分:1)
我还会为OkHttp添加proguard选项:
-keepattributes Signature
-keepattributes *Annotation*
-keep class com.squareup.okhttp.** { *; }
-keep interface com.squareup.okhttp.** { *; }
-dontwarn com.squareup.okhttp.**
仔细检查proguard文件是否确实在正确的位置。