I'm trying to create an APK using ProGuard and the new Gradle 3.0.0 version. I'm getting a lot of warnings on classes that I thought I ignored in my ProGuard configuration file. The same configuration works well with Gradle 2.3.3 but seems to break on 3.0.0. The warnings are so many it's almost not reading the ProGuard configuration at all.
My build.gradle
buildscript {
repositories {
mavenCentral()
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.0.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
}
}
allprojects {
repositories {
jcenter()
maven {
url 'https://jitpack.io'
}
maven {
url 'https://maven.google.com'
}
}
}
android{
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
signingConfig signingConfigs.release
lintOptions {
disable 'MissingTranslation'
}
}
compileSdkVersion 27
buildToolsVersion "27.0.1"
defaultConfig {
minSdkVersion 16
targetSdkVersion 27
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
Proguard warning below.
Warning: library class android.animation.FloatArrayEvaluator extends or implements program class android.animation.TypeEvaluator
Warning: library class android.animation.IntArrayEvaluator extends or implements program class android.animation.TypeEvaluator
Warning: library class android.animation.PointFEvaluator extends or implements program class android.animation.TypeEvaluator
Warning: library class android.animation.RectEvaluator extends or implements program class android.animation.TypeEvaluator
Warning: library class android.app.ActivityManager$TaskDescription extends or implements program class android.os.Parcelable
Warning: library class android.app.AlarmManager$AlarmClockInfo extends or implements program class android.os.Parcelable
Warning: library class android.app.AuthenticationRequiredException extends or implements program class android.os.Parcelable
Warning: library class android.app.AutomaticZenRule extends or implements program class android.os.Parcelable
Warning: library class android.app.Notification$Action extends or implements program class android.os.Parcelable
Warning: library class android.app.Notification$DecoratedCustomViewStyle extends or implements program class android.app.Notification$Style
Warning: library class android.app.Notification$MediaStyle extends or implements program class android.app.Notification$Style
Warning: library class android.app.Notification$MessagingStyle extends or implements program class android.app.Notification$Style
Warning: library class android.app.NotificationChannel extends or implements program class android.os.Parcelable
Warning: library class android.app.NotificationChannelGroup extends or implements program class android.os.Parcelable
Warning: library class android.app.NotificationManager$Policy extends or implements program class android.os.Parcelable
Warning: library class android.app.PictureInPictureParams extends or implements program class android.os.Parcelable
Warning: library class android.app.Presentation extends or implements program class android.app.Dialog
Warning: library class android.app.RemoteAction extends or implements program class android.os.Parcelable
Warning: library class android.app.RemoteInput extends or implements program class android.os.Parcelable
Warning: library class android.app.VoiceInteractor$PickOptionRequest$Option extends or implements program class android.os.Parcelable
Warning: library class android.app.VoiceInteractor$Prompt extends or implements program class android.os.Parcelable
Warning: library class android.app.WallpaperColors extends or implements program class android.os.Parcelable
Warning: library class android.app.admin.ConnectEvent extends or implements program class android.os.Parcelable
Warning: library class android.app.admin.DeviceAdminService extends or implements program class android.app.Service
Warning: library class android.app.admin.DnsEvent extends or implements program class android.os.Parcelable
Warning: library class android.app.admin.NetworkEvent extends or implements program class android.os.Parcelable
Warning: library class android.app.admin.SecurityLog$SecurityEvent extends or implements program class android.os.Parcelable
Warning: library class android.app.admin.SystemUpdateInfo extends or implements program class android.os.Parcelable
Warning: library class android.app.admin.SystemUpdatePolicy extends or implements program class android.os.Parcelable
Warning: library class android.app.assist.AssistContent extends or implements program class android.os.Parcelable
Warning: library class android.app.assist.AssistStructure extends or implements program class android.os.Parcelable
Warning: library class android.app.job.JobInfo extends or implements program class android.os.Parcelable
Warning: library class android.util.FloatProperty extends or implements program class android.util.Property
Warning: library class android.util.IntProperty extends or implements program class android.util.Property
Warning: library class android.view.ActionMode$Callback2 extends or implements program class android.view.ActionMode$Callback
Warning: library class android.view.Display$HdrCapabilities extends or implements program class android.os.Parcelable
Warning: library class android.view.Display$Mode extends or implements program class android.os.Parcelable
Warning: library class android.view.DragAndDropPermissions extends or implements program class android.os.Parcelable
Warning: library class android.view.KeyboardShortcutGroup extends or implements program class android.os.Parcelable
Warning: library class android.view.KeyboardShortcutInfo extends or implements program class android.os.Parcelable
Warning: library class android.view.PointerIcon extends or implements program class android.os.Parcelable
Warning: library class android.view.WindowAnimationFrameStats extends or implements program class android.os.Parcelable
Warning: library class android.view.WindowContentFrameStats extends or implements program class android.os.Parcelable
Warning: library class android.view.WindowId extends or implements program class android.os.Parcelable
Warning: library class android.view.accessibility.AccessibilityWindowInfo extends or implements program class android.os.Parcelable
Warning: library class android.view.animation.BaseInterpolator extends or implements program class android.view.animation.Interpolator
Warning: library class android.view.autofill.AutofillId extends or implements program class android.os.Parcelable
Warning: library class android.view.autofill.AutofillValue extends or implements program class android.os.Parcelable
Warning: library class android.view.inputmethod.CursorAnchorInfo extends or implements program class android.os.Parcelable
Warning: library class android.view.inputmethod.InputContentInfo extends or implements program class android.os.Parcelable
Warning: library class android.widget.ActionMenuView extends or implements program class android.widget.LinearLayout
Warning: library class android.widget.ActionMenuView$LayoutParams extends or implements program class android.widget.LinearLayout$LayoutParams
Warning: library class android.app.RemoteInput depends on program class android.content.Intent
Warning: library class android.app.RemoteInput depends on program class android.os.Bundle
Warning: library class android.app.RemoteInput depends on program class android.content.Intent
Warning: library class android.app.RemoteInput depends on program class android.os.Parcel
Warning: library class android.app.RemoteInput$Builder depends on program class android.os.Bundle
Warning: library class android.app.RemoteInput$Builder depends on program class android.os.Bundle
Warning: library class android.app.SharedElementCallback depends on program class android.view.View
Warning: library class android.app.SharedElementCallback depends on program class android.graphics.Matrix
Warning: library class android.app.SharedElementCallback depends on program class android.graphics.RectF
Warning: library class android.app.SharedElementCallback depends on program class android.os.Parcelable
Warning: library class android.app.SharedElementCallback depends on program class android.content.Context
Warning: library class android.media.session.MediaController$TransportControls depends on program class android.net.Uri
Warning: library class android.media.session.MediaController$TransportControls depends on program class android.os.Bundle
Warning: library class android.media.session.MediaController$TransportControls depends on program class android.os.Bundle
Warning: library class android.media.session.MediaController$TransportControls depends on program class android.os.Bundle
Warning: library class android.media.session.MediaSession depends on program class android.content.Context
Warning: library class android.media.session.MediaSession depends on program class android.os.Handler
Warning: library class android.media.session.MediaSession depends on program class android.app.PendingIntent
Warning: library class android.media.session.MediaSession depends on program class android.app.PendingIntent
Warning: library class android.media.session.MediaSession depends on program class android.os.Bundle
Warning: library class android.media.session.MediaSession depends on program class android.os.Bundle
Warning: library class android.media.session.MediaSession$Callback depends on program class android.os.Bundle
Warning: library class android.media.session.MediaSession$Callback depends on program class android.os.ResultReceiver
Warning: library class android.media.session.MediaSession$Callback depends on program class android.content.Intent
Warning: library class android.media.session.MediaSession$Callback depends on program class android.os.Bundle
Warning: library class android.media.session.MediaSession$Callback depends on program class android.os.Bundle
Warning: library class android.media.session.MediaSession$Callback depends on program class android.net.Uri
Warning: library class android.media.session.MediaSession$Callback depends on program class android.os.Bundle
Warning: library class android.media.session.MediaSession$Callback depends on program class android.os.Bundle
Warning: library class android.media.session.MediaSession$Callback depends on program class android.os.Bundle
Warning: library class android.media.session.MediaSession$Callback depends on program class android.net.Uri
Warning: library class android.media.session.MediaSession$Callback depends on program class android.os.Bundle
Warning: library class android.media.session.MediaSession$Callback depends on program class android.os.Bundle
Warning: library class android.media.session.MediaSession$QueueItem depends on program class android.os.Parcelable$Creator
Warning: library class android.media.session.MediaSession$QueueItem depends on program class android.os.Parcel
Warning: library class android.media.session.MediaSession$Token depends on program class android.os.Parcelable$Creator
Warning: library class android.media.session.MediaSession$Token depends on program class android.os.Parcel
Warning: library class android.media.session.PlaybackState depends on program class android.os.Parcelable$Creator
Warning: library class android.media.session.PlaybackState depends on program class android.os.Parcel
Warning: library class android.media.session.PlaybackState depends on program class android.os.Bundle
Warning: library class android.media.session.PlaybackState$Builder depends on program class android.os.Bundle
Warning: library class android.media.session.PlaybackState$CustomAction depends on program class android.os.Parcelable$Creator
Warning: library class android.media.session.PlaybackState$CustomAction depends on program class android.os.Parcel
Warning: library class android.media.session.PlaybackState$CustomAction depends on program class android.os.Bundle
Warning: library class android.media.session.PlaybackState$CustomAction$Builder depends on program class android.os.Bundle
Warning: library class android.net.Network depends on program class android.os.Parcelable$Creator
Warning: library class android.net.Network depends on program class android.os.Parcel
Warning: library class android.os.LocaleList depends on program class android.os.Parcelable$Creator
Warning: library class android.os.LocaleList depends on program class android.os.Parcel
Warning: library class android.os.PersistableBundle depends on program class android.os.Parcelable$Creator
Warning: library class android.os.PersistableBundle depends on program class android.os.Parcel
Warning: library class android.os.UserManager depends on program class android.os.Bundle
Warning: library class android.os.UserManager depends on program class android.os.Bundle
Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
Warning: library class android.provider.DocumentsContract depends on program class android.content.Context
Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
Warning: library class android.provider.DocumentsContract depends on program class android.content.ContentResolver
Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
Warning: library class android.provider.DocumentsContract depends on program class android.graphics.Point
Warning: library class android.provider.DocumentsContract depends on program class android.os.CancellationSignal
Warning: library class android.provider.DocumentsContract depends on program class android.graphics.Bitmap
Warning: library class android.provider.DocumentsContract depends on program class android.content.ContentResolver
Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
Warning: library class android.provider.DocumentsContract depends on program class android.content.ContentResolver
Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
Warning: library class android.provider.DocumentsContract depends on program class android.content.ContentResolver
Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
Warning: library class android.provider.DocumentsContract depends on program class android.content.ContentResolver
Warning: library class android.security.KeyPairGeneratorSpec depends on program class android.content.Context
Warning: library class android.security.KeyPairGeneratorSpec$Builder depends on program class android.content.Context
Warning: library class android.service.media.MediaBrowserService depends on program class android.content.Intent
Warning: library class android.service.media.MediaBrowserService depends on program class android.os.IBinder
Warning: library class android.service.media.MediaBrowserService depends on program class android.os.Bundle
Warning: library class android.service.media.MediaBrowserService depends on program class android.os.Bundle
Warning: library class android.service.media.MediaBrowserService depends on program class android.os.Bundle
Warning: library class android.service.media.MediaBrowserService depends on program class android.os.Bundle
Warning: library class android.service.media.MediaBrowserService$BrowserRoot depends on program class android.os.Bundle
Warning: library class android.service.media.MediaBrowserService$BrowserRoot depends on program class android.os.Bundle
Warning: library class android.widget.Toolbar depends on program class android.util.AttributeSet
Warning: library class android.widget.Toolbar depends on program class android.graphics.drawable.Drawable
Warning: library class android.widget.Toolbar depends on program class android.graphics.drawable.Drawable
Warning: library class android.widget.Toolbar depends on program class android.content.Context
Warning: library class android.widget.Toolbar depends on program class android.content.Context
Warning: library class android.widget.Toolbar depends on program class android.graphics.drawable.Drawable
Warning: library class android.widget.Toolbar depends on program class android.graphics.drawable.Drawable
Warning: library class android.widget.Toolbar depends on program class android.view.View$OnClickListener
Warning: library class android.widget.Toolbar depends on program class android.view.Menu
Warning: library class android.widget.Toolbar depends on program class android.graphics.drawable.Drawable
Warning: library class android.widget.Toolbar depends on program class android.graphics.drawable.Drawable
Warning: library class android.widget.Toolbar depends on program class android.os.Parcelable
Warning: library class android.widget.Toolbar depends on program class android.os.Parcelable
Warning: library class android.widget.Toolbar depends on program class android.view.MotionEvent
Warning: library class android.widget.Toolbar depends on program class android.util.AttributeSet
Warning: library class android.widget.Toolbar depends on program class android.view.ViewGroup$LayoutParams
Warning: library class android.widget.Toolbar depends on program class android.view.ViewGroup$LayoutParams
Warning: library class android.widget.Toolbar depends on program class android.view.ViewGroup$LayoutParams
Warning: library class android.widget.Toolbar depends on program class android.view.ViewGroup$LayoutParams
Warning: library class android.widget.Toolbar depends on program class android.view.ViewGroup$LayoutParams
Warning: library class android.widget.Toolbar depends on program class android.util.AttributeSet
Warning: library class android.widget.Toolbar depends on program class android.view.ViewGroup$LayoutParams
Note: there were 15 references to unknown classes.
You should check your configuration for typos.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unknownclass)
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)
Warning: there were 928 instances of library classes depending on program classes.
You must avoid such dependencies since the program classes will be processed, while the library classes will remain unchanged.
(http://proguard.sourceforge.net/manual/troubleshooting.html#dependency)
Warning: there were 53 unresolved references to program class members.
Your input classes appear to be inconsistent.
You may need to recompile the code.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedprogramclassmember)
Warning: Exception while processing task java.io.IOException: Please correct the above warnings first.
:transformClassesAndResourcesWithProguardForCouchdbRelease FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':transformClassesAndResourcesWithProguardForCouchdbRelease'.
> Job failed, see logs for details
I've upgraded to gradle 3.0.1 and most of the warnings are gone. If you're still on 3.0.0 then use this in your proguard file
-dontwarn android.**
Not ideal but gets it working.
I had the same issue, although my case is kind of unique, here is my solution:
After upgrading to the new 3.0.1 version (com.android.tools.build:gradle:3.0.1), I saw fewer warnings (originally I had >3000 warnings).
The source of my problem was that I used a library which had a dependency on the whole android framework (This one: https://github.com/tony19/logback-android, the issue #73).
I also looked into the dependencies (./gradlew app:dependenices), because I had libraries which depends on the old apache http client, which also causes some warnings. I had to eliminate them as well.
It may help you
Enabling ProGuard for local library modules no longer affects the library's code. Instead, you should run ProGuard on the app module that consumes the library.
https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html
Related
Note: there were 1188 duplicate class definitions.
(http://proguard.sourceforge.net/manual/troubleshooting.html#duplicateclass)
Initializing...
Note: the configuration refers to the unknown class 'rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef'
Note: the configuration refers to the unknown class 'rx.internal.util.atomic.LinkedQueueNode'
Note: the configuration refers to the unknown class 'rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef'
Note: the configuration refers to the unknown class 'rx.internal.util.atomic.LinkedQueueNode'
Note: the configuration refers to the unknown class 'dagger.internal.Binding'
Maybe you meant the fully qualified name 'com.sun.xml.internal.ws.wsdl.writer.document.Binding'?
Maybe you meant the fully qualified name 'com.sun.xml.internal.ws.wsdl.writer.document.http.Binding'?
Maybe you meant the fully qualified name 'dagger.internal.codegen.Binding'?
Maybe you meant the fully qualified name 'javax.naming.Binding'?
Maybe you meant the fully qualified name 'javax.xml.ws.Binding'?
Maybe you meant the fully qualified name 'org.eclipse.jdt.internal.compiler.lookup.Binding'?
Maybe you meant the fully qualified name 'org.omg.CosNaming.Binding'?
Note: the configuration refers to the unknown class 'dagger.internal.ModuleAdapter'
Note: the configuration refers to the unknown class 'dagger.internal.StaticInjection'
Note: the configuration refers to the unknown class 'Object'
Maybe you meant the fully qualified name 'java.lang.Object'?
Maybe you meant the fully qualified name 'org.omg.CORBA.Object'?
Note: the configuration refers to the unknown class 'org.greenrobot.eventbus.Subscribe'
Maybe you meant the fully qualified name 'com.squareup.otto.Subscribe'?
Maybe you meant the fully qualified name 'com.google.common.eventbus.Subscribe'?
Note: the configuration refers to the unknown class 'org.greenrobot.eventbus.ThreadMode'
Note: the configuration refers to the unknown class 'org.greenrobot.eventbus.util.ThrowableFailureEvent'
Note: the configuration refers to the unknown class 'com.google.android.gms.location.LocationServices'
Note: the configuration refers to the unknown class 'com.abed.hexagonrecyclerview.view.HorizontallyAdaptableHexagonImageView'
Note: the configuration refers to the unknown class 'com.abed.hexagonrecyclerview.view.VerticallyAdaptableHexagonImageView'
Note: the configuration refers to the unknown class 'com.facebook.drawee.view.SimpleDraweeView'
Warning: library class dagger.producers.monitoring.internal.Monitors$1 extends or implements program class javax.inject.Provider
Note: bo.app.aw: can't find dynamically referenced class com.amazon.device.messaging.ADM
Note: com.google.android.exoplayer.extractor.ExtractorSampleSource: can't find dynamically referenced class com.google.android.exoplayer.ext.flac.FlacExtractor
Note: com.google.android.gms.internal.zzast: can't find dynamically referenced class android.os.SystemProperties
Note: com.google.android.youtube.player.internal.aa: can't find dynamically referenced class com.google.android.youtube.api.locallylinked.LocallyLinkedFactory
Note: com.squareup.okhttp.internal.Platform: can't find dynamically referenced class com.android.org.conscrypt.SSLParametersImpl
Note: com.squareup.okhttp.internal.Platform: can't find dynamically referenced class org.apache.harmony.xnet.provider.jsse.SSLParametersImpl
Note: com.squareup.okhttp.internal.Platform: can't find dynamically referenced class sun.security.ssl.SSLContextImpl
Note: okhttp3.internal.platform.AndroidPlatform: can't find dynamically referenced class com.android.org.conscrypt.SSLParametersImpl
Note: okhttp3.internal.platform.AndroidPlatform: can't find dynamically referenced class org.apache.harmony.xnet.provider.jsse.SSLParametersImpl
Note: okhttp3.internal.platform.AndroidPlatform$CloseGuard: can't find dynamically referenced class dalvik.system.CloseGuard
Note: okhttp3.internal.platform.Platform: can't find dynamically referenced class sun.security.ssl.SSLContextImpl
Note: com.google.android.gms.dynamite.DynamiteModule accesses a declared field 'MODULE_ID' dynamically
Maybe this is program field 'com.google.android.gms.dynamite.descriptors.com.google.android.gms.flags.ModuleDescriptor { java.lang.String MODULE_ID; }'
Note: com.google.android.gms.dynamite.DynamiteModule accesses a declared field 'MODULE_VERSION' dynamically
Maybe this is program field 'com.google.android.gms.dynamite.descriptors.com.google.android.gms.flags.ModuleDescriptor { int MODULE_VERSION; }'
Note: com.google.android.gms.dynamite.DynamiteModule accesses a declared field 'sClassLoader' dynamically
Maybe this is program field 'com.google.android.gms.dynamite.DynamiteModule$DynamiteLoaderClassLoader { java.lang.ClassLoader sClassLoader; }'
Note: com.google.gson.internal.UnsafeAllocator accesses a declared field 'theUnsafe' dynamically
Note: the configuration explicitly specifies 'sun.misc.Unsafe' to keep library class 'sun.misc.Unsafe'
Note: the configuration explicitly specifies 'org.xmlpull.v1.**' to keep library class 'org.xmlpull.v1.XmlPullParser'
Note: the configuration explicitly specifies 'org.xmlpull.v1.**' to keep library class 'org.xmlpull.v1.XmlPullParserException'
Note: the configuration explicitly specifies 'org.xmlpull.v1.**' to keep library class 'org.xmlpull.v1.XmlPullParserFactory'
Note: the configuration explicitly specifies 'org.xmlpull.v1.**' to keep library class 'org.xmlpull.v1.XmlSerializer'
Note: there were 15 references to unknown classes.
You should check your configuration for typos.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unknownclass)
Note: there were 5 library classes explicitly being kept.
You don't need to keep library classes; they are already left unchanged.
(http://proguard.sourceforge.net/manual/troubleshooting.html#libraryclass)
Note: there were 11 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 4 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 1 instances of library classes depending on program classes.
You must avoid such dependencies, since the program classes will
be processed, while the library classes will remain unchanged.
(http://proguard.sourceforge.net/manual/troubleshooting.html#dependency)
Warning: Exception while processing task java.io.IOException: Please correct the above warnings first.
:app:transformClassesAndResourcesWithProguardForRelease FAILED
:app:transformClassesAndResourcesWithProguardForRelease (Thread[Daemon worker Thread 3,5,main]) completed. Took 4.602 secs.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
> Job failed, see logs for details
* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.
BUILD FAILED
Total time: 7.685 secs
Stopped 0 worker daemon(s).
I solved this error by adding few lines in proguard. I was using twitter library in gradle.
-keepattributes *Annotation*
-keepattributes SourceFile,LineNumberTable
-keep public class * extends java.lang.Exception
-printmapping mapping.txt
-keep class com.crashlytics.** { *; }
-dontwarn com.crashlytics.**
-dontwarn com.squareup.okhttp.**
-dontwarn com.google.appengine.api.urlfetch.**
-dontwarn rx.**
-dontwarn retrofit.**
-keepattributes Signature
-keepattributes *Annotation*
-keep class com.squareup.okhttp.** { *; }
-keep interface com.squareup.okhttp.** { *; }
-keep class retrofit.** { *; }
-keepclasseswithmembers class * {
#retrofit.http.* <methods>;
}
Make sure to upgrade to the latest Gradle version to use the
annotationProcessor syntax:
dependencies {
compile "com.google.dagger:dagger:2.9"
annotationProcessor "com.google.dagger:dagger-compiler:2.9"
provided 'javax.annotation:jsr250-api:1.0'
}
Taken from android wiki in codepath
In the debug mode everything runs fine.When generating signed APK with minify enabled as true apk is not generated.Here's the error log and the proguard file configuration.
My gradle version is 2.10 and target sdk version is 23.
Note: there were 7 duplicate class definitions.
(http://proguard.sourceforge.net/manual/troubleshooting.html#duplicateclass)
Initializing...
Note: the configuration refers to the unknown class 'com.google.vending.licensing.ILicensingService'
Note: the configuration refers to the unknown class 'com.android.vending.licensing.ILicensingService'
'Field.getType'
Note: com.google.android.gms.internal.zzaix calls 'Class.getGenericSuperclass'
Note: com.google.android.gms.internal.zzaix calls 'Class.getTypeParameters'
Note: com.google.android.gms.internal.zzaix$zza calls 'Field.getGenericType'
Note: com.google.android.gms.internal.zzaix$zza calls 'Method.getGenericParameterTypes'
Note: com.google.android.gms.internal.zzaky calls 'Class.getGenericInterfaces'
Note: com.google.android.gms.internal.zzaky calls 'Class.getGenericSuperclass'
Note: com.google.android.gms.internal.zzaky calls 'Class.getTypeParameters'
Note: com.google.android.gms.internal.zzala calls 'Field.getType'
Note: com.google.android.gms.internal.zzalq calls 'Class.getGenericSuperclass'
Note: com.google.android.gms.internal.zzalq calls 'Field.getGenericType'
Note: com.google.android.gms.internal.zzalq calls 'Field.getType'
Note: com.google.android.gms.internal.zzalv calls 'Class.getGenericSuperclass'
Note: com.google.android.gms.internal.zzamk calls 'Field.getType'
Note: com.google.gson.FieldAttributes calls 'Field.getGenericType'
Note: com.google.gson.FieldAttributes calls 'Field.getType'
Note: com.google.gson.internal.$Gson$Types calls 'Class.getGenericInterfaces'
Note: com.google.gson.internal.$Gson$Types calls 'Class.getGenericSuperclass'
Note: com.google.gson.internal.$Gson$Types calls 'Class.getTypeParameters'
Note: com.google.gson.internal.Excluder calls 'Field.getType'
Note: com.google.gson.internal.bind.ReflectiveTypeAdapterFactory calls 'Field.getType'
Note: com.google.gson.internal.bind.ReflectiveTypeAdapterFactory calls 'Field.getGenericType'
Note: com.google.gson.internal.bind.ReflectiveTypeAdapterFactory calls 'Class.getGenericSuperclass'
Note: com.google.gson.reflect.TypeToken calls 'Class.getGenericSuperclass'
Note: com.google.gson.reflect.TypeToken calls 'Class.getTypeParameters'
Note: com.google.gson.reflect.TypeToken calls 'Class.getGenericInterfaces'
Note: retrofit.MethodHandler calls 'Method.getGenericReturnType'
Note: retrofit.RequestFactoryParser calls 'Method.getGenericParameterTypes'
Note: butterknife.internal.BindingClass calls 'Class.getEnclosingClass'
Note: com.google.android.gms.internal.zzaky$zzb calls 'Class.getEnclosingClass'
Note: com.google.gson.internal.$Gson$Types$ParameterizedTypeImpl calls 'Class.getEnclosingClass'
Warning:butterknife.internal.ButterKnifeProcessor: can't find superclass or interface javax.annotation.processing.AbstractProcessor
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.annotation.processing.AbstractProcessor
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.annotation.processing.ProcessingEnvironment
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.TypeElement
class javax.lang.model.element.TypeElement
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.type.TypeKind
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.SourceVersion
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced field 'javax.annotation.processing.ProcessingEnvironment processingEnv' in program class butterknife.internal.ButterKnifeProcessor
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.annotation.processing.ProcessingEnvironment
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.tools.Diagnostic$Kind
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.annotation.processing.Messager
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.util.Elements
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.PackageElement
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.Element
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.AnnotationMirror
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.annotation.processing.AbstractProcessor
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.annotation.processing.RoundEnvironment
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.TypeElement
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.Element
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.type.TypeMirror
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.type.DeclaredType
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.ExecutableElement
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.VariableElement
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.annotation.processing.ProcessingEnvironment
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.annotation.processing.Filer
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.tools.JavaFileObject
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.annotation.processing.RoundEnvironment
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.Modifier
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.ElementKind
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.type.TypeKind
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.util.Types
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.util.Elements
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.util.Types
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.annotation.processing.Filer
class javax.annotation.processing.RoundEnvironment
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.TypeElement
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.annotation.processing.RoundEnvironment
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.Element
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.annotation.processing.RoundEnvironment
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.TypeElement
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.annotation.processing.RoundEnvironment
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.TypeElement
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.Element
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.TypeElement
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.Modifier
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.TypeElement
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.Element
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.TypeElement
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.type.TypeMirror
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.annotation.processing.RoundEnvironment
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.Element
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.annotation.processing.RoundEnvironment
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.TypeElement
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.annotation.processing.RoundEnvironment
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.TypeElement
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.Element
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.type.TypeVariable
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.VariableElement
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.Element
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.TypeElement
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.type.TypeMirror
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.type.DeclaredType
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.Element
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.TypeElement
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.type.TypeMirror
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.TypeElement
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.type.TypeMirror
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.TypeElement
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.SourceVersion
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.Element
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.TypeElement
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.Element
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.AnnotationMirror
Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.Element
Warning:retrofit.Platform$Java8: can't find referenced method 'boolean isDefault()' in library class java.lang.reflect.Method
Warning:retrofit.Platform$Java8: can't find referenced class java.lang.invoke.MethodHandles
Warning:retrofit.Platform$Java8: can't find referenced class java.lang.invoke.MethodHandles$Lookup
Warning:retrofit.Platform$Java8: can't find referenced class java.lang.invoke.MethodHandle
Warning:retrofit.Platform$Java8: can't find referenced class java.lang.invoke.MethodHandles
Warning:retrofit.Platform$Java8: can't find referenced class java.lang.invoke.MethodHandles$Lookup
Warning:retrofit.Platform$Java8: can't find referenced class java.lang.invoke.MethodHandle
Warning:retrofit.Platform$Java8: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
Note: android.support.v4.media.IMediaBrowserServiceCallbacksAdapterApi21: can't find dynamically referenced class android.service.media.IMediaBrowserServiceCallbacks
Note: android.support.v4.media.IMediaBrowserServiceCallbacksAdapterApi21: can't find dynamically referenced class android.content.pm.ParceledListSlice
Note: android.support.v4.media.IMediaBrowserServiceCallbacksAdapterApi21$Stub: can't find dynamically referenced class android.service.media.IMediaBrowserServiceCallbacks$Stub
Note: android.support.v4.media.ParceledListSliceAdapterApi21: can't find dynamically referenced class android.content.pm.ParceledListSlice
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.google.android.gms.internal.zzaey: can't find dynamically referenced class com.google.appengine.api.ThreadManager
Note: com.google.android.gms.internal.zzalh: can't find dynamically referenced class sun.misc.Unsafe
Note: com.google.android.gms.maps.internal.zzad: can't find dynamically referenced class com.google.android.gms.maps.internal.CreatorImpl
Note: com.google.gson.internal.UnsafeAllocator: can't find dynamically referenced class sun.misc.Unsafe
Note: com.onesignal.ActivityLifecycleListenerCompat: can't find dynamically referenced class android.app.ActivityThread
Note: com.onesignal.OSUtils: can't find dynamically referenced class com.amazon.device.messaging.ADM
Note: com.onesignal.OneSignal: can't find dynamically referenced class com.amazon.device.iap.PurchasingListener
Note: com.onesignal.TrackAmazonPurchase: can't find dynamically referenced class com.amazon.device.iap.internal.d
Note: com.onesignal.TrackGooglePurchase: can't find dynamically referenced class com.android.vending.billing.IInAppBillingService
Note: com.onesignal.TrackGooglePurchase$1: can't find dynamically referenced class com.android.vending.billing.IInAppBillingService$Stub
Note: com.onesignal.shortcutbadger.impl.XiaomiHomeBadger: can't find dynamically referenced class android.app.MiuiNotification
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: retrofit.Platform: can't find dynamically referenced class java.util.Optional
Note: android.support.v4.app.NotificationCompatJellybean accesses a declared field 'icon' dynamically
Maybe this is program field 'android.support.design.R$attr { int icon; }'
Maybe this is program field 'android.support.design.R$id { int icon; }'
Maybe this is program field 'android.support.v4.app.NotificationCompat$Action { int icon; }'
Maybe this is program field 'android.support.v7.appcompat.R$attr { int icon; }'
Maybe this is program field 'android.support.v7.appcompat.R$id { int icon; }'
Maybe this is program field 'android.support.v7.mediarouter.R$attr { int icon; }'
Maybe this is program field 'android.support.v7.mediarouter.R$id { int icon; }'
Maybe this is program field 'com.cameoapps.watchon.R$attr { int icon; }'
Maybe this is program field 'com.cameoapps.watchon.R$id { int icon; }'
Maybe this is program field 'com.cameoapps.watchon.rest.models.Event { java.lang.String icon; }'
Maybe this is program field 'com.cameoapps.watchon.rest.models.Match { java.lang.String icon; }'
Maybe this is program field 'com.cameoapps.watchon.rest.models.PlayersDetail { java.lang.String icon; }'
Maybe this is program field 'com.cameoapps.watchon.rest.models.Sport { java.lang.String icon; }'
Maybe this is program field 'com.cameoapps.watchon.rest.models.SportDetails { java.lang.String icon; }'
Maybe this is program field 'com.cameoapps.watchon.rest.models.TeamsDetail { java.lang.String icon; }'
Maybe this is program field 'com.cameoapps.watchon.rest.models.Tournament { java.lang.String icon; }'
Maybe this is program field 'com.cameoapps.watchon.rest.models.TournamentDetails { java.lang.String icon; }'
Maybe this is program field 'com.google.android.gms.R$attr { int icon; }'
Maybe this is program field 'com.google.android.gms.R$id { int icon; }'
Maybe this is program field 'com.onesignal.OSNotificationPayload$ActionButton { java.lang.String icon; }'
Maybe this is library field 'android.R$attr { int icon; }'
Maybe this is library field 'android.R$id { int icon; }'
Maybe this is library field 'android.app.LauncherActivity$ListItem { android.graphics.drawable.Drawable icon; }'
Maybe this is library field 'android.app.Notification { int icon; }'
Maybe this is library field 'android.app.Notification$Action { int icon; }'
Maybe this is library field 'android.appwidget.AppWidgetProviderInfo { int icon; }'
Maybe this is library field 'android.content.pm.PackageItemInfo { int icon; }'
Maybe this is library field 'android.content.pm.ResolveInfo { int icon; }'
Maybe this is library field 'android.inputmethodservice.Keyboard$Key { android.graphics.drawable.Drawable icon; }'
Maybe this is library field 'android.speech.tts.TextToSpeech$EngineInfo { int icon; }'
Note: android.support.v4.app.NotificationCompatJellybean accesses a declared field 'title' dynamically
Maybe this is program field 'android.support.design.R$attr { int title; }'
Maybe this is program field 'android.support.design.R$id { int title; }'
Maybe this is program field 'android.support.v4.app.NotificationCompat$Action { java.lang.CharSequence title; }'
Maybe this is program field 'android.support.v7.appcompat.R$attr { int title; }'
Maybe this is program field 'android.support.v7.appcompat.R$id { int title; }'
Maybe this is program field 'android.support.v7.mediarouter.R$attr { int title; }'
Maybe this is program field 'android.support.v7.mediarouter.R$id { int title; }'
Maybe this is program field 'com.cameoapps.watchon.R$attr { int title; }'
Maybe this is program field 'com.cameoapps.watchon.R$id { int title; }'
Maybe this is program field 'com.cameoapps.watchon.activities.FilteredEventsActivity { java.lang.String title; }'
Maybe this is program field 'com.cameoapps.watchon.rest.models.Match { java.lang.String title; }'
Maybe this is program field 'com.google.android.gms.R$attr { int title; }'
Maybe this is program field 'com.google.android.gms.R$id { int title; }'
Maybe this is program field 'com.google.android.gms.games.internal.player.PlayerColumnNames { java.lang.String title; }'
Maybe this is program field 'com.google.android.gms.vision.barcode.Barcode$ContactInfo { java.lang.String title; }'
Maybe this is program field 'com.google.android.gms.vision.barcode.Barcode$UrlBookmark { java.lang.String title; }'
Maybe this is program field 'com.onesignal.OSNotificationPayload { java.lang.String title; }'
Maybe this is library field 'android.R$attr { int title; }'
Maybe this is library field 'android.R$id { int title; }'
Maybe this is library field 'android.app.Notification$Action { java.lang.CharSequence title; }'
Maybe this is library field 'android.preference.PreferenceActivity$Header { java.lang.CharSequence title; }'
Note: android.support.v4.app.NotificationCompatJellybean accesses a declared field 'actionIntent' dynamically
Maybe this is program field 'android.support.v4.app.NotificationCompat$Action { android.app.PendingIntent actionIntent; }'
Maybe this is library field 'android.app.Notification$Action { android.app.PendingIntent actionIntent; }'
Note: com.google.android.gms.internal.zzalh accesses a declared field 'theUnsafe' dynamically
Note: com.google.android.gms.internal.zzqi accesses a declared field 'MODULE_ID' dynamically
Maybe this is program field 'com.google.android.gms.dynamite.descriptors.com.google.android.gms.ads.dynamite.ModuleDescriptor { java.lang.String MODULE_ID; }'
Maybe this is program field 'com.google.android.gms.dynamite.descriptors.com.google.android.gms.firebase_database.ModuleDescriptor { java.lang.String MODULE_ID; }'
Maybe this is program field 'com.google.android.gms.dynamite.descriptors.com.google.android.gms.flags.ModuleDescriptor { java.lang.String MODULE_ID; }'
Maybe this is program field 'com.google.android.gms.dynamite.descriptors.com.google.android.gms.tagmanager.ModuleDescriptor { java.lang.String MODULE_ID; }'
Note: com.google.android.gms.internal.zzqi accesses a declared field 'MODULE_VERSION' dynamically
Maybe this is program field 'com.google.android.gms.dynamite.descriptors.com.google.android.gms.ads.dynamite.ModuleDescriptor { int MODULE_VERSION; }'
Maybe this is program field 'com.google.android.gms.dynamite.descriptors.com.google.android.gms.firebase_database.ModuleDescriptor { int MODULE_VERSION; }'
Maybe this is program field 'com.google.android.gms.dynamite.descriptors.com.google.android.gms.flags.ModuleDescriptor { int MODULE_VERSION; }'
Maybe this is program field 'com.google.android.gms.dynamite.descriptors.com.google.android.gms.tagmanager.ModuleDescriptor { int MODULE_VERSION; }'
Note: com.google.gson.internal.UnsafeAllocator accesses a declared field 'theUnsafe' dynamically
Note: com.onesignal.ActivityLifecycleListenerCompat accesses a declared field 'mInstrumentation' dynamically
Note: com.onesignal.TrackAmazonPurchase accesses a declared field 'f' dynamically
Note: com.onesignal.shortcutbadger.impl.XiaomiHomeBadger accesses a declared field 'messageCount' dynamically
Note: there were 4 references to unknown classes.
You should check your configuration for typos.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unknownclass)
Note: there were 28 classes trying to access generic signatures using reflection.
You should consider keeping the signature attributes
(using '-keepattributes Signature').
(http://proguard.sourceforge.net/manual/troubleshooting.html#attributes)
Note: there were 3 classes trying to access enclosing classes using reflection.
You should consider keeping the inner classes attributes
(using '-keepattributes InnerClasses').
(http://proguard.sourceforge.net/manual/troubleshooting.html#attributes)
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 10 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 247 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)
Warning:there were 1 unresolved references to program class members.
Your input classes appear to be inconsistent.
You may need to recompile the code.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedprogramclassmember)
Warning:there were 1 unresolved references to library class members.
You probably need to update the library versions.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedlibraryclassmember)
Warning:Exception while processing task java.io.IOException: Please correct the above warnings first.
:app:transformClassesAndResourcesWithProguardForRelease FAILED
Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
> java.io.IOException: Please correct the above warnings first.
Information:BUILD FAILED
Information:Total time: 18.303 secs
Information:1 error
Information:185 warnings
Hers's my proguard file.
# Retain generated class which implement ViewBinder.
-keep public class * implements butterknife.internal.ViewBinder { public <init>(); }
# Prevent obfuscation of types which use ButterKnife annotations since the simple name
# is used to reflectively look up the generated ViewBinder.
-keep class butterknife.*
-keepclasseswithmembernames class * { #butterknife.* <methods>; }
-keepclasseswithmembernames class * { #butterknife.* <fields>; }
-keep class **$$ViewBinder { *; }
-keepnames class * { #butterknife.Bind *;}
-dontwarn android.support.v7.**
-keep class android.support.v7.** { *; }
-keep interface android.support.v7.** { *; }
Here's build.gradle
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
dexOptions {
javaMaxHeapSize "4g" //specify the heap size for the dex process
}
defaultConfig {
applicationId "com.cameoapps.watchon"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
manifestPlaceholders = [manifestApplicationId : "${applicationId}",
onesignal_app_id : "6dasd33e-9c52-4f73-b6cb-3e41b129edbb",
onesignal_google_project_number: "22699sdfsdf03"]
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/services/javax.annotation.processing.Processor'
}
lintOptions {
checkReleaseBuilds false
disable 'InvalidPackage'
abortOnError false
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
apt 'org.parceler:parceler:1.0.4'
compile 'com.onesignal:OneSignal:2.+#aar'
compile 'com.android.support:multidex:1.0.0'
compile 'com.android.support:appcompat-v7:23.3.0'
compile'com.android.support:design:23.3.0'
compile'com.google.code.gson:gson:2.2.4'
compile'com.squareup.retrofit:retrofit:2.0.0-beta2'
compile 'com.squareup.retrofit:converter-gson:2.0.0-beta2'
compile 'com.squareup.okhttp:okhttp:2.4.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'org.parceler:parceler-api:1.0.4'
compile 'com.android.support:support-v4:23.3.0'
compile 'com.android.support:recyclerview-v7:23.3.0'
compile 'com.android.support:cardview-v7:23.3.0'
compile 'com.google.android.gms:play-services:9.0.2'
compile 'com.google.firebase:firebase-ads:9.0.2'
compile 'com.google.firebase:firebase-core:9.0.2'
}
apply plugin: 'com.google.gms.google-services'
-dontwarn butterknife.internal.** is save according to this
-dontwarn retrofit.** is save according to this
For ButterKnife proguard rules use:
# Retain generated class which implement ViewBinder.
-keep public class * implements butterknife.internal.ViewBinder { public <init>(); }
# Prevent obfuscation of types which use ButterKnife annotations since the simple name
# is used to reflectively look up the generated ViewBinder.
-keep class butterknife.*
-keepclasseswithmembernames class * { #butterknife.* <methods>; }
-keepclasseswithmembernames class * { #butterknife.* <fields>; }
Read about ButterKnife rule issue for 7.0.1.
For other proguard rule snippet, you can visit android-proguard-snippets for more information.
An advice:
Instead of declaring each configuration file manually, you could also store them in a seperate directory and include them all at once:
FileCollection proGuardFileCollection = files { file('./proguard').listFiles() }
proguardFiles(proGuardFileCollection)
more at android-proguard-snippets.
I'm not using jackson in my project. I'm only using gson library and still when I'm trying to build release apk, proguard shows lots of warnings.
Here are the warnings:-
Warning:org.immutables.gson.adapter.ExpectedSubtypesAdapter$JsonParserReaderSupplier: can't find referenced class com.fasterxml.jackson.databind.util.TokenBuffer
Warning:org.immutables.gson.adapter.FieldNamingTranslator: can't find referenced class sun.reflect.ReflectionFactory
Warning:org.immutables.gson.stream.GsonMessageBodyProvider$GsonProviderOptions: can't find referenced class org.immutables.value.Value$Immutable
Warning:org.immutables.gson.stream.GsonMessageBodyProvider$GsonProviderOptions: can't find referenced class org.immutables.value.Value$Style
Warning:org.immutables.gson.stream.GsonMessageBodyProvider$GsonProviderOptions: can't find referenced class org.immutables.value.Value$Style$ImplementationVisibility
Warning:org.immutables.gson.stream.GsonMessageBodyProvider$GsonProviderOptions: can't find referenced class org.immutables.value.Value
Warning:org.immutables.gson.stream.GsonMessageBodyProvider$GsonProviderOptions: can't find referenced class org.immutables.value.Value$Immutable
Warning:org.immutables.gson.stream.GsonMessageBodyProvider$GsonProviderOptions: can't find referenced class org.immutables.value.Value$Style
Warning:org.immutables.gson.stream.GsonMessageBodyProvider$GsonProviderOptions: can't find referenced class org.immutables.value.Value$Style$ImplementationVisibility
Warning:org.immutables.gson.stream.GsonMessageBodyProvider$JacksonStreamer: can't find referenced class com.fasterxml.jackson.core.JsonFactory
Warning:org.immutables.gson.stream.GsonMessageBodyProvider$JacksonStreamer: can't find referenced class com.fasterxml.jackson.core.JsonGenerator
Warning:org.immutables.gson.stream.GsonMessageBodyProvider$JacksonStreamer: can't find referenced class com.fasterxml.jackson.core.JsonFactory
Warning:org.immutables.gson.stream.GsonMessageBodyProvider$JacksonStreamer: can't find referenced class com.fasterxml.jackson.core.JsonParser$Feature
Warning:org.immutables.gson.stream.GsonMessageBodyProvider$JacksonStreamer: can't find referenced class com.fasterxml.jackson.core.JsonFactory
Warning:org.immutables.gson.stream.GsonMessageBodyProvider$JacksonStreamer: can't find referenced class com.fasterxml.jackson.core.JsonGenerator$Feature
Warning:org.immutables.gson.stream.GsonMessageBodyProvider$JacksonStreamer: can't find referenced class com.fasterxml.jackson.core.JsonFactory
Warning:org.immutables.gson.stream.GsonMessageBodyProvider$JacksonStreamer: can't find referenced class com.fasterxml.jackson.core.JsonGenerator
Warning:org.immutables.gson.stream.GsonMessageBodyProvider$JacksonStreamer: can't find referenced class com.fasterxml.jackson.core.JsonParser$Feature
Warning:org.immutables.gson.stream.GsonMessageBodyProvider$JacksonStreamer: can't find referenced class com.fasterxml.jackson.core.JsonGenerator$Feature
Warning:org.immutables.gson.stream.GsonMessageBodyProvider$JacksonStreamer: can't find referenced class com.fasterxml.jackson.core.JsonParser
Warning:org.immutables.gson.stream.GsonMessageBodyProvider$JacksonStreamer: can't find referenced class com.fasterxml.jackson.core.JsonFactory
Warning:org.immutables.gson.stream.GsonMessageBodyProvider$JacksonStreamer: can't find referenced class com.fasterxml.jackson.core.JsonGenerator
Warning:org.immutables.gson.stream.JsonGeneratorWriter: can't find referenced class com.fasterxml.jackson.core.JsonGenerator
Warning:org.immutables.gson.stream.JsonParserReader: can't find referenced class com.fasterxml.jackson.core.JsonParser
Warning:org.immutables.gson.stream.JsonParserReader: can't find referenced class com.fasterxml.jackson.core.JsonToken
Warning:org.immutables.gson.stream.JsonParserReader: can't find referenced class com.fasterxml.jackson.core.JsonParser
Warning:org.immutables.gson.stream.JsonParserReader: can't find referenced class com.fasterxml.jackson.core.JsonToken
Warning:org.immutables.gson.stream.JsonParserReader: can't find referenced class com.fasterxml.jackson.core.JsonParser
Warning:org.immutables.gson.stream.JsonParserReader: can't find referenced class com.fasterxml.jackson.core.JsonToken
Warning:org.immutables.gson.stream.JsonParserReader: can't find referenced class com.fasterxml.jackson.core.JsonParser
Warning:org.immutables.gson.stream.JsonParserReader: can't find referenced class com.fasterxml.jackson.core.JsonToken
Warning:org.immutables.gson.stream.JsonParserReader: can't find referenced class com.fasterxml.jackson.databind.util.TokenBuffer
Warning:org.immutables.gson.stream.JsonParserReader: can't find referenced class com.fasterxml.jackson.core.JsonToken
Warning:org.immutables.gson.stream.JsonParserReader: can't find referenced class com.fasterxml.jackson.core.JsonParser
Warning:org.immutables.gson.stream.JsonParserReader: can't find referenced class com.fasterxml.jackson.core.JsonToken
Warning:org.immutables.gson.stream.JsonParserReader: can't find referenced class com.fasterxml.jackson.core.JsonParser
Warning:org.immutables.gson.stream.JsonParserReader: can't find referenced class com.fasterxml.jackson.core.JsonToken
Warning:org.immutables.gson.stream.JsonParserReader: can't find referenced class com.fasterxml.jackson.core.JsonParser
Warning:org.immutables.gson.stream.JsonParserReader: can't find referenced class com.fasterxml.jackson.core.JsonToken
Warning:org.immutables.gson.stream.JsonParserReader: can't find referenced class com.fasterxml.jackson.core.JsonParser
Warning:org.immutables.gson.stream.JsonParserReader: can't find referenced class com.fasterxml.jackson.databind.util.TokenBuffer
Warning:org.immutables.gson.stream.JsonParserReader: can't find referenced class com.fasterxml.jackson.core.JsonParser
Warning:org.immutables.gson.stream.JsonParserReader$2: can't find referenced class com.fasterxml.jackson.core.JsonToken
Warning:org.parceler.ParcelAnnotationProcessor: can't find referenced method 'void init(javax.annotation.processing.ProcessingEnvironment)' in program class org.parceler.transfuse.AnnotationProcessorBase
Warning:org.parceler.ParcelAnnotationProcessor: can't find referenced class com.google.auto.service.AutoService
Warning:org.parceler.apache.commons.beanutils.MappedPropertyDescriptor: can't find referenced method 'void setName(java.lang.String)' in program class org.parceler.apache.commons.beanutils.MappedPropertyDescriptor
Warning:org.parceler.apache.commons.logging.impl.AvalonLogger: can't find referenced class org.parceler.apache.avalon.framework.logger.Logger
Warning:org.parceler.apache.commons.logging.impl.Log4JLogger: can't find referenced class org.parceler.apache.log4j.Category
Warning:org.parceler.apache.commons.logging.impl.Log4JLogger: can't find referenced class org.parceler.apache.log4j.Priority
Warning:org.parceler.apache.commons.logging.impl.Log4JLogger: can't find referenced class org.parceler.apache.log4j.Logger
Warning:org.parceler.apache.commons.logging.impl.Log4JLogger: can't find referenced class org.parceler.apache.log4j.Category
Warning:org.parceler.apache.commons.logging.impl.Log4JLogger: can't find referenced class org.parceler.apache.log4j.Logger
Warning:org.parceler.apache.commons.logging.impl.Log4JLogger: can't find referenced class org.parceler.apache.log4j.Priority
Warning:org.parceler.apache.commons.logging.impl.Log4JLogger: can't find referenced class org.parceler.apache.log4j.Logger
Warning:org.parceler.apache.commons.logging.impl.LogKitLogger: can't find referenced class org.parceler.apache.log.Hierarchy
Warning:org.parceler.apache.commons.logging.impl.LogKitLogger: can't find referenced class org.parceler.apache.log.Logger
Warning:org.parceler.codemodel.util.SingleByteEncoder: can't find referenced class sun.nio.cs.Surrogate$Parser
Warning:org.parceler.codemodel.util.SingleByteEncoder: can't find referenced class sun.nio.cs.Surrogate
Warning:org.parceler.codemodel.util.SingleByteEncoder: can't find referenced class sun.nio.cs.Surrogate$Parser
Warning:org.parceler.codemodel.util.SingleByteEncoder: can't find referenced class sun.nio.cs.Surrogate
Warning:org.parceler.codemodel.util.SingleByteEncoder: can't find referenced class sun.nio.cs.Surrogate$Parser
Warning:org.parceler.guava.cache.Striped64: can't find referenced class sun.misc.Unsafe
Warning:org.parceler.guava.cache.Striped64$1: can't find referenced class sun.misc.Unsafe
Warning:org.parceler.guava.cache.Striped64$Cell: can't find referenced class sun.misc.Unsafe
Warning:org.parceler.guava.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator: can't find referenced class sun.misc.Unsafe
Warning:org.parceler.guava.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator$1: can't find referenced class sun.misc.Unsafe
Warning:org.parceler.transfuse.bootstrap.BootstrapProcessor: can't find referenced field 'javax.annotation.processing.ProcessingEnvironment processingEnv' in program class org.parceler.transfuse.bootstrap.BootstrapProcessor
Warning:org.parceler.transfuse.gen.FilerResourceWriter: can't find referenced class javax.tools.JavaFileManager$Location
Warning:org.parceler.transfuse.gen.FilerResourceWriter: can't find referenced class javax.tools.JavaFileManager
Warning:org.parceler.transfuse.gen.FilerResourceWriter: can't find referenced class javax.tools.StandardLocation
Warning:org.parceler.transfuse.gen.FilerResourceWriter: can't find referenced class javax.tools.FileObject
Warning:org.parceler.transfuse.gen.FilerSourceCodeWriter: can't find referenced class javax.tools.JavaFileObject
Warning:org.parceler.transfuse.util.MessagerLogger: can't find referenced class javax.tools.Diagnostic$Kind
Warning:org.parceler.transfuse.util.MessagerLogger: can't find referenced class javax.tools.Diagnostic
Warning:org.parceler.transfuse.util.MessagerLogger: can't find referenced class javax.tools.Diagnostic$Kind
Warning:org.parceler.transfuse.validation.Validator: can't find referenced class javax.tools.Diagnostic$Kind
Warning:org.parceler.transfuse.validation.Validator: can't find referenced class javax.tools.Diagnostic
Warning:org.parceler.transfuse.validation.Validator: can't find referenced class javax.tools.Diagnostic$Kind
Warning:org.parceler.transfuse.validation.Validator$ValidationBuilder: can't find referenced class javax.tools.Diagnostic$Kind
Warning:org.parceler.transfuse.validation.Validator$ValidationBuilder: can't find referenced class javax.tools.Diagnostic
Warning:org.parceler.transfuse.validation.Validator$ValidationBuilder: can't find referenced class javax.tools.Diagnostic$Kind
here is my complete proguard file
# Apache
-keep class org.apache.http.** { *; }
-dontwarn org.apache.http.**
-dontwarn android.net.**
# ButterKnife 7
-keep class butterknife.** { *; }
-dontwarn butterknife.internal.**
-keep class **$$ViewBinder { *; }
-keepclasseswithmembernames class * {
#butterknife.* <fields>;
}
-keepclasseswithmembernames class * {
#butterknife.* <methods>;
}
# Crashlytics 1.+
-keep class com.crashlytics.** { *; }
-keepattributes SourceFile,LineNumberTable
# Deeplink dispatch
-keep class com.airbnb.deeplinkdispatch.** { *; }
-keepclasseswithmembers class * { #com.airbnb.deeplinkdispatch.DeepLink <methods>;}
# Configuration for Fabric Twitter Kit
# See: https://dev.twitter.com/twitter-kit/android/integrate
-dontwarn com.squareup.okhttp.**
-dontwarn com.google.appengine.api.urlfetch.**
-dontwarn rx.**
-dontwarn retrofit.**
-keepattributes Signature
-keepattributes *Annotation*
-keep class com.squareup.okhttp.** { *; }
-keep interface com.squareup.okhttp.** { *; }
-keep class retrofit.** { *; }
-keepclasseswithmembers class * {
#retrofit.http.* *;
}
# Facebook 3.2
-keep class com.facebook.** { *; }
-keepattributes Signature
## Google Play Services 4.3.23 specific rules ##
## https://developer.android.com/google/play-services/setup.html#Proguard ##
-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 * implements android.os.Parcelable {
public static final ** CREATOR;
}
## GSON 2.2.4 specific rules ##
# Gson uses generic type information stored in a class file when working with fields. Proguard
# removes such information by default, so configure it to keep all of it.
-keepattributes Signature
# For using GSON #Expose annotation
-keepattributes *Annotation*
-keepattributes EnclosingMethod
# Gson specific classes
-keep class sun.misc.Unsafe { *; }
-keep class com.google.gson.stream.** { *; }
# MoPub Proguard Config
# NOTE: You should also include the Android Proguard config found with the build tools:
# $ANDROID_HOME/tools/proguard/proguard-android.txt
# Keep public classes and methods.
-keepclassmembers class com.mopub.** { public *; }
-keep public class com.mopub.**
-keep public class android.webkit.JavascriptInterface {}
# Explicitly keep any custom event classes in any package.
-keep class * extends com.mopub.mobileads.CustomEventBanner {}
-keep class * extends com.mopub.mobileads.CustomEventInterstitial {}
-keep class * extends com.mopub.nativeads.CustomEventNative {}
-keep class * extends com.mopub.mobileads.GooglePlayServicesBanner {}
-keep class * extends com.mopub.nativeads.AvocarrotNativeMopub {}
# Support for Android Advertiser ID.
-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 {*;}
# Simple-fb
-keep class com.sromku.simple.fb.entities.** { *; }
# OkHttp
-keepattributes Signature
-keepattributes *Annotation*
-keep class com.squareup.okhttp.** { *; }
-keep interface com.squareup.okhttp.** { *; }
-dontwarn com.squareup.okhttp.**
## Square Otto specific rules ##
## https://square.github.io/otto/ ##
# Otto
-keepattributes *Annotation*
-keepclassmembers class ** {
#com.squareup.otto.Subscribe public *;
#com.squareup.otto.Produce public *;
}
## Square Picasso specific rules ##
## https://square.github.io/picasso/ ##
-dontwarn com.squareup.okhttp.**
# Retrofit 1.X
-keep class com.squareup.okhttp.** { *; }
-keep class retrofit.** { *; }
-keep interface com.squareup.okhttp.** { *; }
-dontwarn com.squareup.okhttp.**
-dontwarn okio.**
-dontwarn retrofit.**
-dontwarn rx.**
-keepclasseswithmembers class * {
#retrofit.http.* <methods>;
}
# If in your rest service interface you use methods with Callback argument.
-keepattributes Exceptions
# If your rest service methods throw custom exceptions, because you've defined an ErrorHandler.
-keepattributes Signature
# Also you must note that if you are using GSON for conversion from JSON to POJO representation, you must ignore those POJO classes from being obfuscated.
# Here include the POJO's that have you have created for mapping JSON response to POJO for example.
-keep class com.myproject.model.** { *; }
# Android design
-dontwarn android.support.design.**
-keep class android.support.design.** { *; }
-keep interface android.support.design.** { *; }
-keep public class android.support.design.R$* { *; }
-keep public class android.support.v7.widget.** { *; }
-keep public class android.support.v7.internal.widget.** { *; }
-keep public class android.support.v7.internal.view.menu.** { *; }
-keep public class * extends android.support.v4.view.ActionProvider {
public <init>(android.content.Context);
}
# app specific
-keepclassmembers class com.myproject.** {
public *;
}
# Removing logs
-assumenosideeffects class android.util.Log {
public static boolean isLoggable(java.lang.String, int);
public static int v(...);
public static int i(...);
public static int w(...);
public static int d(...);
public static int e(...);
}
# Keep the support library
-keep class android.support.v4.** { *; }
-keep interface android.support.v4.** { *; }
# The support library contains references to newer platform versions.
# Don't warn about those in case this app is linking against an older
# platform version. We know about them, and they are safe.
-dontwarn android.support.**
## ---------------- End Project specifics ---------------- ##
Please help, how do fix it.
If you are still getting error after adding keepattributes line as suggested by Emanuel Seidinger, please add dontwarn directive for packages causing issues.
-dontwarn org.codehaus.jackson.**
I would attack the problem with a different angle. What I see here is that warnings you provided might indicate unintended leakage of compilation-only artifacts to the actual compile/runtime classpath which is processed by ProGuard.
In particular, annotation processors (such as ParcelAnnotationProcessor) and optional annotations should not be included in the regular compilation scope.
Usually what you can do is to set scope of such dependencies to provided or compileOnly depending on the apt plugin you use (assuming you use Gradle to build android app)
As one of the authors of org.immutables libraries I already faced and discussed some difficulties with a ProGuard which might do not recognize special compile-only scopes etc. In your particular case you use org.immutables:gson artifact which contains optional Jackson-Gson integration bridge classes which are propagated to build. You usually do not need those classes on Android. As a solution I would suggest to just replace org.immutables:gson artifact with annotation-only version available using annotations classifier (using like provided "org.immutables:gson:2.1.11:annotations"). This artifact excludes any unwanted Jackson-dependent classes.
See sample Gradle configuration when using Immutables annotation processor: http://immutables.github.io/getstarted.html#android
I'm also using GSON in an Android project. You can try the proguard configuration found here android-proguard-example. You have to adapt the last line in the example for the model classes in your project which will be serialized using GSON.
I do have the following lines in my proguard config because of GSON:
-keepattributes Signature
-keepattributes *Annotation*
I'm developing an app with Android Studio 1.0.2 and Gradle 1.0.0 using the Apache libraries httpmime and httpcore for multipart entities. Here's my build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.1"
// Something wrong with the http* libs
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
defaultConfig {
// ...
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile "com.android.support:support-v4:21.0.2"
compile 'org.apache.httpcomponents:httpcore:4.3.2'
compile 'org.apache.httpcomponents:httpmime:4.3.5'
compile 'net.hockeyapp.android:HockeySDK:3.5.0'
}
The app itself and the 'normal' release APKs work fine, but when I'm trying to use ProGuard I get the following error message:
Note: there were 157 duplicate class definitions.
(http://proguard.sourceforge.net/manual/troubleshooting.html#duplicateclass)
Warning:library class org.apache.http.auth.AuthenticationException extends or implements program class org.apache.http.ProtocolException
Warning:library class org.apache.http.auth.MalformedChallengeException extends or implements program class org.apache.http.ProtocolException
Warning:library class org.apache.http.auth.params.AuthParamBean extends or implements program class org.apache.http.params.HttpAbstractParamBean
Warning:library class org.apache.http.client.NonRepeatableRequestException extends or implements program class org.apache.http.ProtocolException
Warning:library class org.apache.http.client.RedirectException extends or implements program class org.apache.http.ProtocolException
Warning:library class org.apache.http.client.entity.UrlEncodedFormEntity extends or implements program class org.apache.http.entity.StringEntity
Warning:library class org.apache.http.client.methods.HttpEntityEnclosingRequestBase extends or implements program class org.apache.http.HttpEntityEnclosingRequest
Warning:library class org.apache.http.client.methods.HttpRequestBase extends or implements program class org.apache.http.message.AbstractHttpMessage
Warning:library class org.apache.http.client.methods.HttpUriRequest extends or implements program class org.apache.http.HttpRequest
Warning:library class org.apache.http.client.params.AllClientPNames extends or implements program class org.apache.http.params.CoreConnectionPNames
Warning:library class org.apache.http.client.params.AllClientPNames extends or implements program class org.apache.http.params.CoreProtocolPNames
Warning:library class org.apache.http.client.params.ClientParamBean extends or implements program class org.apache.http.params.HttpAbstractParamBean
Warning:library class org.apache.http.client.protocol.RequestAddCookies extends or implements program class org.apache.http.HttpRequestInterceptor
Warning:library class org.apache.http.client.protocol.RequestDefaultHeaders extends or implements program class org.apache.http.HttpRequestInterceptor
Warning:library class org.apache.http.client.protocol.RequestProxyAuthentication extends or implements program class org.apache.http.HttpRequestInterceptor
Warning:library class org.apache.http.client.protocol.RequestTargetAuthentication extends or implements program class org.apache.http.HttpRequestInterceptor
Warning:library class org.apache.http.client.protocol.ResponseProcessCookies extends or implements program class org.apache.http.HttpResponseInterceptor
Warning:library class org.apache.http.conn.BasicManagedEntity extends or implements program class org.apache.http.entity.HttpEntityWrapper
Warning:library class org.apache.http.conn.ManagedClientConnection extends or implements program class org.apache.http.HttpClientConnection
Warning:library class org.apache.http.conn.ManagedClientConnection extends or implements program class org.apache.http.HttpInetConnection
Warning:library class org.apache.http.conn.OperatedClientConnection extends or implements program class org.apache.http.HttpClientConnection
Warning:library class org.apache.http.conn.OperatedClientConnection extends or implements program class org.apache.http.HttpInetConnection
Warning:library class org.apache.http.conn.params.ConnConnectionParamBean extends or implements program class org.apache.http.params.HttpAbstractParamBean
Warning:library class org.apache.http.conn.params.ConnManagerParamBean extends or implements program class org.apache.http.params.HttpAbstractParamBean
Warning:library class org.apache.http.conn.params.ConnRouteParamBean extends or implements program class org.apache.http.params.HttpAbstractParamBean
Warning:library class org.apache.http.cookie.MalformedCookieException extends or implements program class org.apache.http.ProtocolException
Warning:library class org.apache.http.cookie.params.CookieSpecParamBean extends or implements program class org.apache.http.params.HttpAbstractParamBean
Warning:library class org.apache.http.impl.client.ClientParamsStack extends or implements program class org.apache.http.params.AbstractHttpParams
Warning:library class org.apache.http.impl.client.EntityEnclosingRequestWrapper extends or implements program class org.apache.http.HttpEntityEnclosingRequest
Warning:library class org.apache.http.impl.client.RequestWrapper extends or implements program class org.apache.http.message.AbstractHttpMessage
Warning:library class org.apache.http.impl.client.TunnelRefusedException extends or implements program class org.apache.http.HttpException
Warning:library class org.apache.http.impl.conn.DefaultClientConnection extends or implements program class org.apache.http.impl.SocketHttpClientConnection
Warning:library class org.apache.http.impl.conn.DefaultResponseParser extends or implements program class org.apache.http.impl.io.AbstractMessageParser
Warning:library class org.apache.http.impl.conn.LoggingSessionInputBuffer extends or implements program class org.apache.http.io.SessionInputBuffer
Warning:library class org.apache.http.impl.conn.LoggingSessionOutputBuffer extends or implements program class org.apache.http.io.SessionOutputBuffer
Warning:library class org.apache.http.client.HttpClient depends on program class org.apache.http.params.HttpParams
Warning:library class org.apache.http.client.HttpClient depends on program class org.apache.http.HttpResponse
Warning:library class org.apache.http.client.HttpClient depends on program class org.apache.http.protocol.HttpContext
Warning:library class org.apache.http.client.HttpClient depends on program class org.apache.http.HttpResponse
Warning:library class org.apache.http.client.HttpClient depends on program class org.apache.http.HttpHost
Warning:library class org.apache.http.client.HttpClient depends on program class org.apache.http.HttpRequest
Warning:library class org.apache.http.client.HttpClient depends on program class org.apache.http.HttpResponse
Warning:library class org.apache.http.client.HttpClient depends on program class org.apache.http.HttpHost
Warning:library class org.apache.http.client.HttpClient depends on program class org.apache.http.HttpRequest
Warning:library class org.apache.http.client.HttpClient depends on program class org.apache.http.protocol.HttpContext
Warning:library class org.apache.http.client.HttpClient depends on program class org.apache.http.HttpResponse
Warning:library class org.apache.http.client.HttpClient depends on program class org.apache.http.protocol.HttpContext
Warning:library class org.apache.http.client.HttpClient depends on program class org.apache.http.HttpHost
Warning:library class org.apache.http.client.HttpClient depends on program class org.apache.http.HttpRequest
Warning:library class org.apache.http.client.HttpClient depends on program class org.apache.http.HttpHost
Warning:library class org.apache.http.client.HttpClient depends on program class org.apache.http.HttpRequest
Warning:library class org.apache.http.client.HttpClient depends on program class org.apache.http.protocol.HttpContext
Warning:library class org.apache.http.client.methods.HttpEntityEnclosingRequestBase depends on program class org.apache.http.HttpEntity
Warning:library class org.apache.http.client.methods.HttpRequestBase depends on program class org.apache.http.ProtocolVersion
Warning:library class org.apache.http.client.methods.HttpRequestBase depends on program class org.apache.http.RequestLine
Warning:library class org.apache.http.conn.scheme.PlainSocketFactory depends on program class org.apache.http.params.HttpParams
Warning:library class org.apache.http.conn.scheme.SchemeRegistry depends on program class org.apache.http.HttpHost
Warning:library class org.apache.http.conn.scheme.SocketFactory depends on program class org.apache.http.params.HttpParams
Warning:library class org.apache.http.conn.ssl.SSLSocketFactory depends on program class org.apache.http.params.HttpParams
Warning:library class org.apache.http.impl.client.AbstractHttpClient depends on program class org.apache.http.params.HttpParams
Warning:library class org.apache.http.impl.client.AbstractHttpClient depends on program class org.apache.http.protocol.HttpContext
Warning:library class org.apache.http.impl.client.AbstractHttpClient depends on program class org.apache.http.protocol.HttpRequestExecutor
Warning:library class org.apache.http.impl.client.AbstractHttpClient depends on program class org.apache.http.ConnectionReuseStrategy
Warning:library class org.apache.http.impl.client.AbstractHttpClient depends on program class org.apache.http.protocol.BasicHttpProcessor
Warning:library class org.apache.http.impl.client.AbstractHttpClient depends on program class org.apache.http.params.HttpParams
Warning:library class org.apache.http.impl.client.AbstractHttpClient depends on program class org.apache.http.protocol.HttpRequestExecutor
Warning:library class org.apache.http.impl.client.AbstractHttpClient depends on program class org.apache.http.ConnectionReuseStrategy
Warning:library class org.apache.http.impl.client.AbstractHttpClient depends on program class org.apache.http.protocol.BasicHttpProcessor
Warning:library class org.apache.http.impl.client.AbstractHttpClient depends on program class org.apache.http.HttpResponseInterceptor
Warning:library class org.apache.http.impl.client.AbstractHttpClient depends on program class org.apache.http.HttpRequestInterceptor
Warning:library class org.apache.http.impl.client.AbstractHttpClient depends on program class org.apache.http.HttpResponse
Warning:library class org.apache.http.impl.client.AbstractHttpClient depends on program class org.apache.http.protocol.HttpContext
Warning:library class org.apache.http.impl.client.AbstractHttpClient depends on program class org.apache.http.HttpResponse
Warning:library class org.apache.http.impl.client.AbstractHttpClient depends on program class org.apache.http.HttpHost
Warning:library class org.apache.http.impl.client.AbstractHttpClient depends on program class org.apache.http.HttpRequest
Warning:library class org.apache.http.impl.client.AbstractHttpClient depends on program class org.apache.http.HttpResponse
Warning:library class org.apache.http.impl.client.AbstractHttpClient depends on program class org.apache.http.HttpHost
Warning:library class org.apache.http.impl.client.AbstractHttpClient depends on program class org.apache.http.HttpRequest
Warning:library class org.apache.http.impl.client.AbstractHttpClient depends on program class org.apache.http.protocol.HttpContext
Warning:library class org.apache.http.impl.client.AbstractHttpClient depends on program class org.apache.http.HttpResponse
Warning:library class org.apache.http.impl.client.AbstractHttpClient depends on program class org.apache.http.protocol.HttpRequestExecutor
Warning:library class org.apache.http.impl.client.AbstractHttpClient depends on program class org.apache.http.ConnectionReuseStrategy
Warning:library class org.apache.http.impl.client.AbstractHttpClient depends on program class org.apache.http.protocol.HttpProcessor
Warning:library class org.apache.http.impl.client.AbstractHttpClient depends on program class org.apache.http.params.HttpParams
Warning:library class org.apache.http.impl.client.AbstractHttpClient depends on program class org.apache.http.HttpRequest
Warning:library class org.apache.http.impl.client.AbstractHttpClient depends on program class org.apache.http.params.HttpParams
Warning:library class org.apache.http.impl.client.AbstractHttpClient depends on program class org.apache.http.protocol.HttpContext
Warning:library class org.apache.http.impl.client.AbstractHttpClient depends on program class org.apache.http.HttpHost
Warning:library class org.apache.http.impl.client.AbstractHttpClient depends on program class org.apache.http.HttpRequest
Warning:library class org.apache.http.impl.client.AbstractHttpClient depends on program class org.apache.http.HttpHost
Warning:library class org.apache.http.impl.client.AbstractHttpClient depends on program class org.apache.http.HttpRequest
Warning:library class org.apache.http.impl.client.AbstractHttpClient depends on program class org.apache.http.protocol.HttpContext
Warning:library class org.apache.http.impl.client.DefaultHttpClient depends on program class org.apache.http.params.HttpParams
Warning:library class org.apache.http.impl.client.DefaultHttpClient depends on program class org.apache.http.protocol.HttpRequestExecutor
Warning:library class org.apache.http.impl.client.DefaultHttpClient depends on program class org.apache.http.protocol.HttpContext
Warning:library class org.apache.http.impl.client.DefaultHttpClient depends on program class org.apache.http.ConnectionReuseStrategy
Warning:library class org.apache.http.impl.client.DefaultHttpClient depends on program class org.apache.http.protocol.BasicHttpProcessor
Warning:library class org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager depends on program class org.apache.http.params.HttpParams
Warning:there were 109 instances of library classes depending on program classes.
You must avoid such dependencies, since the program classes will
be processed, while the library classes will remain unchanged.
(http://proguard.sourceforge.net/manual/troubleshooting.html#dependency)
:app:proguardRelease FAILED
Error:Execution failed for task ':app:proguardRelease'.
> java.io.IOException: Please correct the above warnings first.
According to the links given in the error message about the duplicate class definitions and library classes depending on program classes I should use something like -injars ... or -libraryjars ... in my proguard-rules.pro. But since I use the remote libraries and not the .jar files I don't know how to use these proguard options.
So I googled for a solution for my problem and found several possibilities:
I downloaded the jars, added them to my \app\libs folder and added the options -libraryjar and/or -injar for both jars, but no combination would work: Either the files couldn't be found or read, or I got an error that one of the libs would be processed twice.
I also tried various combinations of -keep class org.apache.**, -keep interface org.apache.**, -keep public class org.apache.** {*;}, -keepnames class org.apache.** {*;} with or without the {*;} but none of them work.
I also tried the -dontwarn org.apache.** or -dontwarn org.apache.http.** option which gives me no errors during creating the APK, but when I try to establish an internet connection using the http* libs in the app, the app crashes with something like a NoSuchMethodException.
So my question is: is there a way using the remote libraries and proguard? Or is it at least possible by including the .jars in my \libs folder?
Thank you very much
Well i am using like this
-dontwarn org.apache.commons.**
-keep class org.apache.http.** { *; }
-dontwarn org.apache.http.**
Also i am compiling using jar inside my libs folder
compile files('libs/httpmime-4.3.5.jar')
compile files('libs/httpclient-4.3.5.jar')
compile files('libs/httpclient-cache-4.3.5.jar')
compile files('libs/httpcore-4.3.2.jar')
instead of using from maven
Try This
-dontwarn org.apache.commons.**
-keep class org.apache.http.** { *; }
-dontwarn org.apache.http.**
-dontwarn com.squareup.okhttp.**
-dontwarn okio.**
-dontwarn retrofit2.**
-keep class retrofit2.** { *; }
I'm able to create builds for my android app, but when I turn on proguard i'm getting numerouos warnings, and then the build fails. The warnings are like the ones below:
Warning: library class android.net.http.AndroidHttpClient depends on program class org.apache.http.HttpRequest
Warning: library class android.net.http.AndroidHttpClient depends on program class org.apache.http.HttpEntity
Warning: library class android.net.http.AndroidHttpClient depends on program class org.apache.http.params.HttpParams
Warning: library class android.net.http.AndroidHttpClient depends on program class org.apache.http.conn.ClientConnectionManager
Warning: library class android.net.http.AndroidHttpClient depends on program class org.apache.http.client.methods.HttpUriRequest
Warning: library class android.net.http.AndroidHttpClient depends on program class org.apache.http.HttpResponse
Warning: library class android.net.http.AndroidHttpClient depends on program class org.apache.http.client.methods.HttpUriRequest
Warning: library class android.net.http.AndroidHttpClient depends on program class org.apache.http.protocol.HttpContext
Warning: library class android.net.http.AndroidHttpClient depends on program class org.apache.http.HttpResponse
Warning: library class android.net.http.AndroidHttpClient depends on program class org.apache.http.HttpHost
Warning: library class android.net.http.AndroidHttpClient depends on program class org.apache.http.HttpRequest
Warning: library class android.net.http.AndroidHttpClient depends on program class org.apache.http.HttpResponse
Warning: library class android.net.http.AndroidHttpClient depends on program class org.apache.http.HttpHost
Warning: library class android.net.http.AndroidHttpClient depends on program class org.apache.http.HttpRequest
Warning: library class android.net.http.AndroidHttpClient depends on program class org.apache.http.protocol.HttpContext
Warning: library class android.net.http.AndroidHttpClient depends on program class org.apache.http.HttpResponse
Warning: library class android.net.http.AndroidHttpClient depends on program class org.apache.http.client.methods.HttpUriRequest
Warning: library class android.net.http.AndroidHttpClient depends on program class org.apache.http.client.ResponseHandler
Warning: library class android.net.http.AndroidHttpClient depends on program class org.apache.http.client.methods.HttpUriRequest
Warning: library class android.net.http.AndroidHttpClient depends on program class org.apache.http.client.ResponseHandler
Warning: library class android.net.http.AndroidHttpClient depends on program class org.apache.http.protocol.HttpContext
Warning: library class android.net.http.AndroidHttpClient depends on program class org.apache.http.HttpHost
Warning: library class android.net.http.AndroidHttpClient depends on program class org.apache.http.HttpRequest
Warning: library class android.net.http.AndroidHttpClient depends on program class org.apache.http.client.ResponseHandler
Warning: library class android.net.http.AndroidHttpClient depends on program class org.apache.http.HttpHost
Warning: library class android.net.http.AndroidHttpClient depends on program class org.apache.http.HttpRequest
Warning: library class android.net.http.AndroidHttpClient depends on program class org.apache.http.client.ResponseHandler
Warning: library class android.net.http.AndroidHttpClient depends on program class org.apache.http.protocol.HttpContext
Warning: library class android.net.http.AndroidHttpClient depends on program class org.apache.http.entity.AbstractHttpEntity
It's complaining about libraries that were used in my project. My settings are below:
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
proguardFile file('proguard-rules.txt')
signingConfig signingConfigs.release
}
}
Within my proguard-rules.txt I have the following:
-libraryjars libs
All of my libraries are stored in the libs folder. Is there anything else i'm doing wrong?
inspect the jars , creating a packages list in libs you are using.
Then try adding following for those packages in the list in your proguard config file:
-dontwarn org.codehaus.jackson.**
...
-keep class org.codehaus.jackson.** { *; }
Your libraries contain duplicates of the android.http classes, which are already present in the Android runtime. This may cause conflicts. You should remove the duplicate libraries from your project.
See the ProGuard manual > Troubleshooting > Warning: library class ... depends on program class ...