Not able to build release build with proguard enabled - android

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.

Related

gradle build error while generating signed apk

I have created an app ready to be uploaded om playstore. I have created Keystore password and all when the gradle builds I get the following error. This is the first time I am uploading an app on playstore. Below are the error and the build.gradle file...Please help me!!Any other information regarding uploading app is very helpful
Error:
Information:Gradle tasks [:app:assembleRelease]
Warning:okhttp3.Address: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.Authenticator: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.Cache: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.Cache$2: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.Cache$CacheResponseBody: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.Cache$Entry: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.CacheControl: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.CertificatePinner: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.Challenge: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.Connection: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.ConnectionPool: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.ConnectionSpec: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.ConnectionSpec$Builder: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.Cookie: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.Dispatcher: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.EventListener: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.FormBody: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.Handshake: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.Headers: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.HttpUrl: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.HttpUrl$Builder: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.Interceptor$Chain: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.MediaType: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.MultipartBody: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.MultipartBody$Builder: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.MultipartBody$Part: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.OkHttpClient: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.OkHttpClient$Builder: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.Request: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.Request$Builder: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.RequestBody: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.RequestBody$1: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.RequestBody$2: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.RequestBody$3: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.Response: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.Response$Builder: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.ResponseBody: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.ResponseBody$1: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.Route: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.WebSocket: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.WebSocketListener: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.internal.Util: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.internal.cache.CacheStrategy: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.internal.cache.DiskLruCache: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.internal.cache.DiskLruCache$Snapshot: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.internal.connection.RealConnection: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.internal.http.RealResponseBody: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.internal.ws.RealWebSocket: can't find referenced class javax.annotation.Nullable
Warning:okhttp3.package-info: can't find referenced class javax.annotation.ParametersAreNonnullByDefault
Warning:okio.AsyncTimeout: can't find referenced class javax.annotation.Nullable
Warning:okio.Buffer: can't find referenced class javax.annotation.Nullable
Warning:okio.BufferedSource: can't find referenced class javax.annotation.Nullable
Warning:okio.ByteString: can't find referenced class javax.annotation.Nullable
Warning:okio.DeflaterSink: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
Warning:okio.HashingSink: can't find referenced class javax.annotation.Nullable
Warning:okio.Okio: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
Warning:okio.Okio$4: can't find referenced class javax.annotation.Nullable
Warning:okio.RealBufferedSource: can't find referenced class javax.annotation.Nullable
Warning:okio.Segment: can't find referenced class javax.annotation.Nullable
Warning:okio.SegmentPool: can't find referenced class javax.annotation.Nullable
Warning:okio.package-info: can't find referenced class javax.annotation.ParametersAreNonnullByDefault
Warning:there were 181 unresolved references to classes or interfaces.
Warning:Exception while processing task java.io.IOException: Please correct the above warnings first.
Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
> Job failed, see logs for details
Information:BUILD FAILED in 5m 31s
Information:1 error
Information:63 warnings
Information:See complete output in console
build.gradle(app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.abcd.efgh"
minSdkVersion 19
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation 'com.google.firebase:firebase-core:11.6.0'
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.readystatesoftware.systembartint:systembartint:1.0.3'
compile 'com.google.android.gms:play-services-ads:11.6.0'
compile 'com.wdullaer:materialdatetimepicker:3.4.0'
compile 'com.android.support:design:27.0.2'
compile 'com.android.support:appcompat-v7:27.0.2'
compile 'com.squareup.okhttp3:okhttp:3.9.0'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
You have minifyEnabled true for release and perhaps some needed classes for javax.annotation.Nullable are needed but are removed by minifying. If you don't need it for now you can just remove that tag for release. If you do need the flag you have to tinker and configure the minify to keep the class.
What this looks like to me is a transitive dependency issue. Just as you don't want to re-create the wheel and use gradle to import other code well the creaters of the gradle dependencies don't want to re-create the wheel ether so they used gradle too. You end up with nested dependencies that may not use the most recent version. In fact you even excluded group: 'com.android.support', module: 'support-annotations' in the androidtestcompile version to avoid a transitive dependency conflict. I feel your pain. I would go to the gradle tab and try running any task with dependency in the name. Its very verbose to track this type of error, the stack trace you listed will help. Running lint could also help clean up your code and as Yordan mentioned proguard is not required but it does add security by obfusicating the code

Proguard causing error while building release apk

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

Getting Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'. while generating signed apk

I'm trying to generate signed apk of my android app and the task is remaining unsuccessful giving me this error:
Information:Gradle tasks [:app:assembleRelease]
Warning:com.mikepenz.fastadapter_extensions.items.SingleLineItem: can't find referenced class com.mikepenz.materialize.holder.StringHolder
Warning:com.mikepenz.fastadapter_extensions.items.SingleLineItem: can't find referenced class com.mikepenz.materialize.holder.ImageHolder
Warning:com.mikepenz.fastadapter_extensions.items.SingleLineItem: can't find referenced class com.mikepenz.materialize.holder.StringHolder
Warning:com.mikepenz.fastadapter_extensions.items.SingleLineItem: can't find referenced class com.mikepenz.materialize.holder.ImageHolder
Warning:com.mikepenz.fastadapter_extensions.items.SingleLineItem: can't find referenced class com.mikepenz.materialize.holder.StringHolder
Warning:com.mikepenz.fastadapter_extensions.items.SingleLineItem: can't find referenced class com.mikepenz.materialize.holder.ImageHolder
Warning:com.mikepenz.fastadapter_extensions.items.SingleLineItem: can't find referenced class com.mikepenz.materialize.holder.StringHolder
Warning:com.mikepenz.fastadapter_extensions.items.SingleLineItem: can't find referenced class com.mikepenz.materialize.holder.ImageHolder
Warning:com.mikepenz.fastadapter_extensions.items.ThreeLineItem: can't find referenced class com.mikepenz.materialize.holder.StringHolder
Warning:com.mikepenz.fastadapter_extensions.items.ThreeLineItem: can't find referenced class com.mikepenz.materialize.holder.ImageHolder
Warning:com.mikepenz.fastadapter_extensions.items.ThreeLineItem: can't find referenced class com.mikepenz.materialize.holder.StringHolder
Warning:com.mikepenz.fastadapter_extensions.items.ThreeLineItem: can't find referenced class com.mikepenz.materialize.holder.ImageHolder
Warning:com.mikepenz.fastadapter_extensions.items.ThreeLineItem: can't find referenced class com.mikepenz.materialize.holder.StringHolder
Warning:com.mikepenz.fastadapter_extensions.items.ThreeLineItem: can't find referenced class com.mikepenz.materialize.holder.ImageHolder
Warning:com.mikepenz.fastadapter_extensions.items.ThreeLineItem: can't find referenced class com.mikepenz.materialize.holder.StringHolder
Warning:com.mikepenz.fastadapter_extensions.items.ThreeLineItem: can't find referenced class com.mikepenz.materialize.holder.ImageHolder
Warning:com.mikepenz.fastadapter_extensions.items.TwoLineItem: can't find referenced class com.mikepenz.materialize.holder.StringHolder
Warning:com.mikepenz.fastadapter_extensions.items.TwoLineItem: can't find referenced class com.mikepenz.materialize.holder.ImageHolder
Warning:com.mikepenz.fastadapter_extensions.items.TwoLineItem: can't find referenced class com.mikepenz.materialize.holder.StringHolder
Warning:com.mikepenz.fastadapter_extensions.items.TwoLineItem: can't find referenced class com.mikepenz.materialize.holder.ImageHolder
Warning:com.mikepenz.fastadapter_extensions.items.TwoLineItem: can't find referenced class com.mikepenz.materialize.holder.StringHolder
Warning:com.mikepenz.fastadapter_extensions.items.TwoLineItem: can't find referenced class com.mikepenz.materialize.holder.ImageHolder
Warning:com.mikepenz.fastadapter_extensions.items.TwoLineItem: can't find referenced class com.mikepenz.materialize.holder.StringHolder
Warning:com.mikepenz.fastadapter_extensions.items.TwoLineItem: can't find referenced class com.mikepenz.materialize.holder.ImageHolder
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.OkHttpClient
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Cache
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.OkHttpClient
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.CacheControl
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.CacheControl$Builder
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Request$Builder
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.OkHttpClient
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Call
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Response
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.ResponseBody
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Response
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.ResponseBody
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.OkHttpClient
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Cache
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.CacheControl
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.CacheControl$Builder
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Request$Builder
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Response
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Cache
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.CacheControl
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Request
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Call
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Response
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.ResponseBody
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.OkHttpClient
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.CacheControl$Builder
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.CacheControl
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Request$Builder
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Response
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.ResponseBody
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Cache
Warning:rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef: can't find referenced class sun.misc.Unsafe
Warning:rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef: can't find referenced class sun.misc.Unsafe
Warning:rx.internal.util.unsafe.ConcurrentCircularArrayQueue: can't find referenced class sun.misc.Unsafe
Warning:rx.internal.util.unsafe.ConcurrentSequencedCircularArrayQueue: can't find referenced class sun.misc.Unsafe
Warning:rx.internal.util.unsafe.MpmcArrayQueueConsumerField: can't find referenced class sun.misc.Unsafe
Warning:rx.internal.util.unsafe.MpmcArrayQueueProducerField: can't find referenced class sun.misc.Unsafe
Warning:rx.internal.util.unsafe.MpscLinkedQueue: can't find referenced class sun.misc.Unsafe
Warning:rx.internal.util.unsafe.SpmcArrayQueueConsumerField: can't find referenced class sun.misc.Unsafe
Warning:rx.internal.util.unsafe.SpmcArrayQueueProducerField: can't find referenced class sun.misc.Unsafe
Warning:rx.internal.util.unsafe.SpscArrayQueue: can't find referenced class sun.misc.Unsafe
Warning:rx.internal.util.unsafe.SpscUnboundedArrayQueue: can't find referenced class sun.misc.Unsafe
Warning:rx.internal.util.unsafe.UnsafeAccess: can't find referenced class sun.misc.Unsafe
Warning:there were 145 unresolved references to classes or interfaces.
Warning:Exception while processing task java.io.IOException: Please correct the above warnings first.
Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
> Job failed, see logs for details
Information:BUILD FAILED
Information:Total time: 19.342 secs
Information:1 error
Information:69 warnings
Information:See complete output in console
Here's my proguard-rules.pro file:
-keep public class com.mikepenz.fastadapter
-keep public class com.squareup.picasso
-keep public class rx.internal.util.unsafe
Here's build.gradle file:
apply plugin: 'com.android.application'
//Put Fabric plugin after Android plugin
apply plugin: 'io.fabric'
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "com.abc.xxx"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "0.1"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
repositories {
mavenCentral()
maven {
url "https://jitpack.io"
}
maven { url 'https://maven.fabric.io/public' }
}
dexOptions {
javaMaxHeapSize "4g"
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile('com.mikepenz:fastadapter:1.8.2#aar') {
transitive = true
}
compile('com.crashlytics.sdk.android:crashlytics:2.6.6#aar') {
transitive = true;
}
compile 'com.android.support:appcompat-v7:25.0.0'
compile 'com.android.support:design:25.0.0'
compile 'com.android.support:cardview-v7:25.0.0'
compile 'com.android.support:recyclerview-v7:25.0.0'
compile 'com.mikepenz:fastadapter-extensions:1.8.0#aar'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.google.android.gms:play-services:10.2.0'
compile 'com.google.android.gms:play-services-location:10.2.0'
compile 'com.google.firebase:firebase-auth:10.2.0'
compile 'com.android.support:support-v4:25.0.0'
compile 'com.google.firebase:firebase-database:10.2.0'
compile 'com.firebase:geofire-android:2.1.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.google.firebase:firebase-storage:10.2.0'
compile 'com.google.firebase:firebase-core:10.2.0'
compile 'com.google.firebase:firebase-invites:10.2.0'
compile 'hani.momanii.supernova_emoji_library:supernova-emoji-library:0.0.2'
compile 'me.himanshusoni.chatmessageview:chat-message-view:1.0.3'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.firebaseui:firebase-ui:0.4.1'
compile 'pl.charmas.android:android-reactive-location:0.10#aar'
compile 'io.reactivex:rxjava:1.2.0'
compile 'io.reactivex:rxandroid:1.2.1'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.android.support:support-vector-drawable:25.0.0'
compile 'com.github.coyarzun89:fabtransitionactivity:0.2.0'
compile 'org.adw.library:discrete-seekbar:1.0.1'
compile 'com.codemybrainsout.rating:ratingdialog:1.0.7'
compile 'com.github.paolorotolo:appintro:4.1.0'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
Why am I getting these warnings and error and how can I get rid of them?
I tried searching the web and read this doc here, but I'm still unable to figure out.
Please help me with this.
Your problem seems to include proguard exceptions for okhttp which is used by picasso. Add
# OkHttp
-keepattributes Signature
-keepattributes *Annotation*
-keep class com.squareup.okhttp.** { *; }
-keep interface com.squareup.okhttp.** { *; }
-dontwarn com.squareup.okhttp.**
See here for proguard configuration for other libraries you might be using.
For
Warning:com.mikepenz.fastadapter_extensions.items.SingleLineItem:
Apply below Rule
-keep class com.mikepenz.materialize.holder.** { *; }
From Comment discussion #user1140237 it solved it for mikepenz library
but what about
Warning:rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeR‌​ef:
can't find referenced class sun.misc.Unsafe and related warnings?
Add below rule
-dontwarn sun.misc.Unsafe
-dontwarn com.google.common.collect.MinMaxPriorityQueue
Check this link it my help you
For ok http or square related follow the answer given by JohnWowUs

Android - Assertj Android - Run error

I´m trying to run assertj-android but it send an error. (it runs fine with junit 4)
My Dependencies:
dependencies {
testCompile 'junit:junit:4.12'
androidTestCompile ('com.squareup.assertj:assertj-android:1.0.0'){
exclude group:'com.android.support', module:'support-annotations'
}
}
My Build type:
buildTypes {
debug {
signingConfig signingConfigs.debug
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
My progard-rules.pro:
## Assertj
-dontwarn org.assertj.**
-keep class org.assertj.** {*;}
And I get this error on run:
:app:proguardDebugAndroidTest
Warning:org.assertj.core.api.JUnitSoftAssertions: can't find superclass or interface org.junit.rules.TestRule
Warning:org.assertj.core.api.JUnitSoftAssertions$1: can't find superclass or interface org.junit.runners.model.Statement
Warning:org.assertj.core.api.JUnitSoftAssertions: can't find referenced class org.junit.rules.TestRule
Warning:org.assertj.core.api.JUnitSoftAssertions: can't find referenced class org.junit.runners.model.Statement
Warning:org.assertj.core.api.JUnitSoftAssertions: can't find referenced class org.junit.runner.Description
Warning:org.assertj.core.api.JUnitSoftAssertions: can't find referenced class org.junit.runners.model.Statement
Warning:org.assertj.core.api.JUnitSoftAssertions: can't find referenced class org.junit.runner.Description
Warning:org.assertj.core.api.JUnitSoftAssertions$1: can't find referenced class org.junit.runners.model.Statement
Warning:org.assertj.core.api.JUnitSoftAssertions$1: can't find referenced class org.junit.runners.model.MultipleFailureException
Warning:org.assertj.core.api.JUnitSoftAssertions$1: can't find referenced class org.junit.runners.model.Statement
Warning:org.assertj.core.internal.JavaBeanDescriptor: can't find referenced class java.beans.PropertyDescriptor
Warning:org.assertj.core.internal.PropertySupport: can't find referenced class java.beans.PropertyDescriptor
Warning:org.assertj.core.internal.cglib.core.DebuggingClassWriter$1: can't find referenced class org.assertj.core.internal.cglib.asm.util.TraceClassVisitor
Warning:org.assertj.core.internal.cglib.core.ReflectUtils: can't find referenced class java.beans.PropertyDescriptor
Warning:org.assertj.core.internal.cglib.core.ReflectUtils: can't find referenced class java.beans.IntrospectionException
Warning:org.assertj.core.internal.cglib.core.ReflectUtils: can't find referenced class java.beans.Introspector
Warning:org.assertj.core.internal.cglib.core.ReflectUtils: can't find referenced class java.beans.BeanInfo
Warning:org.assertj.core.internal.cglib.core.ReflectUtils: can't find referenced class java.beans.PropertyDescriptor
Warning:org.assertj.core.internal.cglib.core.ReflectUtils: can't find referenced class java.beans.BeanInfo
Warning:org.assertj.core.internal.cglib.core.ReflectUtils: can't find referenced class java.beans.PropertyDescriptor
Warning:org.assertj.core.internal.cglib.core.ReflectUtils: can't find referenced class java.beans.IntrospectionException
Warning:org.assertj.core.util.introspection.Introspection: can't find referenced class java.beans.Introspector
Warning:org.assertj.core.util.introspection.Introspection: can't find referenced class java.beans.BeanInfo
Warning:org.assertj.core.util.introspection.Introspection: can't find referenced class java.beans.PropertyDescriptor
Warning:org.assertj.core.util.introspection.Introspection: can't find referenced class java.beans.BeanInfo
Warning:org.assertj.core.util.xml.XmlStringPrettyFormatter: can't find referenced class org.w3c.dom.bootstrap.DOMImplementationRegistry
Warning:there were 59 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)
:app:proguardDebugAndroidTest FAILED
:app:newRelicDeinstrumentTask
[newrelic.info] Deinstrumenting...
Error:Execution failed for task ':app:proguardDebugAndroidTest'.
> java.io.IOException: Please correct the above warnings first.
Why?
Based on Proguard revision 1.2.0 and post in stackoverflow.
I needed to add testProguardFiles to my debug buildType because tests ignore proguardFiles attribute so it was ignoring my proguard setup:
buildTypes {
debug {
signingConfig signingConfigs.debug
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro', 'proguard-rules-debug.pro'
testProguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro', 'proguard-rules-debug.pro'"true"
}
}
And my proguard file:
## Assertj
-dontwarn org.assertj.core.**
-dontwarn org.junit.**
-dontwarn java.beans.**

Android-Studio-1.2.RC Proguard warnings on Square's Okio library reference

WIth Android Studio: 1.2.RC
I enabled proguard in .gradle:
```
minifyEnabled=true
and added these rules to my proguard-rules.pro:
-dontwarn com.squareup.**
-dontwarn okio.**
and added these lint rules to my .gradle file:
warningsAsErrors false
abortOnError false
disable 'InvalidPackage'
```
But I still get these warning when I try to run the app in debug mode:
```
Warning: okio.DeflaterSink: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
Warning: okio.Okio: can't find referenced class java.nio.file.Files
Warning: okio.Okio: can't find referenced class java.nio.file.Files
Warning: okio.Okio: can't find referenced class java.nio.file.Files
Warning: okio.Okio: can't find referenced class java.nio.file.Path
Warning: okio.Okio: can't find referenced class java.nio.file.OpenOption
Warning: okio.Okio: can't find referenced class java.nio.file.Path
Warning: okio.Okio: can't find referenced class java.nio.file.OpenOption
Warning: okio.Okio: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
Warning: okio.Okio: can't find referenced class java.nio.file.Path
Warning: okio.Okio: can't find referenced class java.nio.file.OpenOption
Warning: okio.Okio: can't find referenced class java.nio.file.Path
Warning: okio.Okio: can't find referenced class java.nio.file.OpenOption
Warning: okio.Okio: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
Warning: there were 14 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)
:app:proguardDebug FAILED
```
It's so weird since I also added these rules/options to all my library modules that depend on OkHttp/Picasso, I don't know where went wrong, perhaps this is a Android Studio bug ? Does anyone have any clues to this problem ?
I have opened an issue on github.
You've disable warnings for
-dontwarn com.squareup.**
-dontwarn okio.**
But what about for packages (as seen in your posted log)
-dontwarn org.codehaus
-dontwarn java.nio
Either way, ignoring warnings is not a good approach.
Try keeping these classes from being minified like so:
-keep public class org.codehaus.**
-keep public class java.nio.**
Oh Christ, I forgot to specify the proguard file for my debug build, adding the 'proguardFiles' rule would solve the problem:
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable false
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
applicationIdSuffix ".debug"
}
}
One of those moments you searched hard for your keys and it's right in your pocket.

Categories

Resources