Error:Execution failed for task
':app:transformClassesAndResourcesWithProguardForRelease'.
java.io.IOException: Please correct the above warnings first.
I have tried my best to find the solution but I did not get, whereas I found many questions.
Is there anything to ignore these warnings, I just want to generate a secure signed apk, therefore I have used minifyEnabled true
Message:
Warning:retrofit.client.OkClient$1: can't find superclass or interface com.squareup.okhttp.RequestBody
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:retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPMethod
Warning:retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.URLFetchServiceFactory
Warning:retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.URLFetchService
Warning:retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPRequest
Warning:retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPHeader
Warning:retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPRequest
Warning:retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPResponse
Warning:retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPRequest
Warning:retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPResponse
Warning:retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPHeader
Warning:retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPResponse
Warning:retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPMethod
Warning:retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPRequest
Warning:retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPResponse
Warning:retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPHeader
Warning:retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPMethod
Warning:retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.URLFetchServiceFactory
Warning:retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.URLFetchService
Warning:retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPResponse
Warning:retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.URLFetchService
Warning:retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPMethod
Warning:retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.URLFetchService
Warning:retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPRequest
Warning:retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPResponse
Warning:retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.URLFetchService
Warning:retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPRequest
Warning:retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPResponse
Warning:retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.URLFetchService
Warning:retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPRequest
Warning:retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPMethod
Warning:retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPRequest
Warning:retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPResponse
Warning:retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPRequest
Warning:retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPHeader
Warning:retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPResponse
Warning:retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPRequest
Warning:retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPHeader
Warning:retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.OkHttpClient
Warning:retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.Call
Warning:retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.Request$Builder
Warning:retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.Response
Warning:retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.Request
Warning:retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.Response
Warning:retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.MediaType
Warning:retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.ResponseBody
Warning:retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.Headers
Warning:retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.OkHttpClient
Warning:retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.Request$Builder
Warning:retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.Call
Warning:retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.Request
Warning:retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.Response
Warning:retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.MediaType
Warning:retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.ResponseBody
Warning:retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.Headers
Warning:retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.OkHttpClient
Warning:retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.Request
Warning:retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.Request$Builder
Warning:retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.Response
Warning:retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.RequestBody
Warning:retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.MediaType
Warning:retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.ResponseBody
Warning:retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.Headers
Warning:retrofit.client.OkClient$1: can't find referenced class com.squareup.okhttp.RequestBody
Warning:retrofit.client.OkClient$1: can't find referenced class okio.BufferedSink
Warning:retrofit.client.OkClient$1: can't find referenced class com.squareup.okhttp.RequestBody
Warning:retrofit.client.OkClient$1: can't find referenced class okio.BufferedSink
Warning:retrofit.client.OkClient$1: can't find referenced class com.squareup.okhttp.MediaType
Warning:retrofit.client.OkClient$1: can't find referenced class okio.BufferedSink
Warning:retrofit.client.OkClient$2: can't find referenced class com.squareup.okhttp.ResponseBody
Warning:retrofit.client.OkClient$2: can't find referenced class com.squareup.okhttp.MediaType
Warning:retrofit.client.OkClient$2: can't find referenced class com.squareup.okhttp.ResponseBody
Warning:retrofit.client.OkClient$2: can't find referenced class com.squareup.okhttp.MediaType
Warning:retrofit.client.OkClient$2: can't find referenced class com.squareup.okhttp.ResponseBody
Warning:retrofit.client.OkClient$2: can't find referenced class com.squareup.okhttp.MediaType
Warning:retrofit.client.OkClient$2: can't find referenced class com.squareup.okhttp.ResponseBody
Warning:retrofit.client.OkClient$2: can't find referenced class com.squareup.okhttp.MediaType
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.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.SpscArrayQueueConsumerField: can't find referenced class sun.misc.Unsafe
Warning:rx.internal.util.unsafe.SpscArrayQueueProducerFields: can't find referenced class sun.misc.Unsafe
Warning:rx.internal.util.unsafe.UnsafeAccess: can't find referenced class sun.misc.Unsafe
When you use ProGuard you have to always resolve all warnings to be able to process further with the build.
These warnings tell you that the libraries reference some code and there are no sources for that. That might and might not be ok. It depends if the problematic code ever get called.
In this case the libraries reference some code but the code doesn't seem to be ever called (e.g. because you didn't add some other library). In that case add -dontwarn rules to proguard-rules.pro file.
You use Retrofit and Picasso libraries. Try adding these rules:
-dontwarn okio.**
-dontwarn retrofit.**
-keep class retrofit.** { *; }
-keepclassmembers,allowobfuscation interface * {
#retrofit.http.** <methods>;
}
-dontwarn com.squareup.okhttp.**
It might fix your problem.
Note that you might experience further problems in runtime especially if any of those libraries use reflection and the code was shrunk and/or obfuscated. Then it's probable that you'll need more ProGuard rules for other libraries.
Edit:
To resolve RxJava related warnings add this dependency:
// ProGuard rules for RxJava
compile 'com.artemzin.rxjava:proguard-rules:1.1.1.0'
It adds necessary ProGuard rules for RxJava.
I had the same issue, and solved it by adding the following text to proguard-project.txt:
# for transformClassesAndResourcesWithProguardForRelease
# -- Picasso --
-dontwarn com.squareup.picasso.**
# -- OkHttp --
-dontwarn com.squareup.okhttp.internal.**
# -- Apache Commons --
-dontwarn org.apache.commons.logging.**
-ignorewarnings
-keep class *
{
public private *;
}
Related
build.gradle (Project)
buildscript {
ext.support_version = '27.0.3'
ext.play_service_version = '11.8.0'
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0-alpha07'
classpath 'com.google.gms:google-services:3.1.1'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
}
}
allprojects {
repositories {
jcenter()
}
}
allprojects {
repositories {
jcenter()
google()
maven {
url 'https://maven.google.com/'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.gradle (app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "xxx.com.xxooking"
minSdkVersion 14
targetSdkVersion 25
versionCode 3
versionName "0.4"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
checkReleaseBuilds false
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support:design:27.1.0'
implementation 'com.squareup.retrofit2:retrofit:2.0.2'
implementation 'com.squareup.retrofit2:converter-gson:2.0.2'
implementation 'com.squareup.retrofit:retrofit:1.9.0'
implementation 'com.orhanobut:dialogplus:1.11#aar'
implementation 'com.google.android.gms:play-services-base:11.8.0'
implementation 'com.google.android.gms:play-services-location:11.8.0'
implementation 'com.google.android.gms:play-services-maps:11.8.0'
implementation 'com.google.android.gms:play-services-places:11.8.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.nineoldandroids:library:2.4.0'
implementation 'com.daimajia.slider:library:1.1.5#aar'
implementation 'com.applozic.communication.uiwidget:mobicomkitui:4.85'
testImplementation 'junit:junit:4.12'
androidTestImplementation('com.android.support:design:27.0.0') {
exclude module: "com.android.support:design"
}
}
Proguard-rules-pro
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-verbose
Error:
//// com.google.firebase.messaging.RemoteMessage: can't find superclass or interface com.google.android.gms.common.internal.safeparcel.zza
retrofit.RxSupport$1: can't find superclass or interface rx.Observable$OnSubscribe
retrofit.client.OkClient$1: can't find superclass or interface com.squareup.okhttp.RequestBody
com.google.firebase.iid.zzb: can't find referenced method 'MessengerCompat(android.os.Handler)' in program class com.google.android.gms.iid.MessengerCompat
com.google.firebase.iid.zzb: can't find referenced method 'android.os.IBinder getBinder()' in program class com.google.android.gms.iid.MessengerCompat
com.google.firebase.iid.zzb$1: can't find referenced method 'int zzc(android.os.Message)' in program class com.google.android.gms.iid.MessengerCompat
com.google.firebase.iid.zzh: can't find referenced method 'java.io.File getNoBackupFilesDir(android.content.Context)' in program class com.google.android.gms.common.util.zzw
com.google.firebase.messaging.RemoteMessage: can't find referenced class com.google.android.gms.common.internal.safeparcel.zza
com.google.firebase.messaging.zza: can't find referenced method 'boolean zzyH()' in program class com.google.android.gms.common.util.zzs
com.google.firebase.messaging.zzb: can't find referenced class com.google.android.gms.measurement.AppMeasurement
com.google.firebase.messaging.zzb: can't find referenced class com.google.android.gms.measurement.AppMeasurement$zza
com.google.firebase.messaging.zzb: can't find referenced class com.google.android.gms.measurement.AppMeasurement$zze
com.google.firebase.messaging.zzb: can't find referenced class com.google.android.gms.measurement.AppMeasurement$zzg
com.google.firebase.messaging.zzb: can't find referenced class com.google.android.gms.measurement.AppMeasurement
com.google.firebase.messaging.zzc: can't find referenced class com.google.android.gms.common.internal.safeparcel.zzb
com.google.firebase.messaging.zzc: can't find referenced class com.google.android.gms.common.internal.safeparcel.zzb$zza
com.google.firebase.messaging.zzc: can't find referenced class com.google.android.gms.common.internal.safeparcel.zzc
com.google.firebase.messaging.zzc: can't find referenced class com.google.android.gms.common.internal.safeparcel.zzb
com.google.firebase.messaging.zzc: can't find referenced class com.google.android.gms.common.internal.safeparcel.zzb$zza
com.google.firebase.messaging.zzc: can't find referenced class com.google.android.gms.common.internal.safeparcel.zzc
com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.OkHttpClient
com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Cache
com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.OkHttpClient
com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.CacheControl
com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.CacheControl$Builder
com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Request$Builder
com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.OkHttpClient
com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Call
com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Response
com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.ResponseBody
com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Response
com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.ResponseBody
com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.OkHttpClient
com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Cache
com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.CacheControl
com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.CacheControl$Builder
com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Request$Builder
com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Response
com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Cache
com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.CacheControl
com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Request
com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Call
com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Response
com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.ResponseBody
com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.OkHttpClient
com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.CacheControl$Builder
com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.CacheControl
com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Request$Builder
com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Response
com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.ResponseBody
com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Cache
okio.DeflaterSink: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
okio.Okio: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
retrofit.RestMethodInfo$RxSupport: can't find referenced class rx.Observable
retrofit.RxSupport: can't find referenced class rx.Observable
retrofit.RxSupport: can't find referenced class rx.Observable$OnSubscribe
retrofit.RxSupport: can't find referenced class rx.Observable
retrofit.RxSupport: can't find referenced class rx.Subscriber
retrofit.RxSupport$1: can't find referenced class rx.subscriptions.Subscriptions
retrofit.RxSupport$1: can't find referenced class rx.Subscriber
retrofit.RxSupport$1: can't find referenced class rx.Observable$OnSubscribe
retrofit.RxSupport$1: can't find referenced class rx.subscriptions.Subscriptions
retrofit.RxSupport$1: can't find referenced class rx.Observable
retrofit.RxSupport$1: can't find referenced class rx.Subscriber
retrofit.RxSupport$1: can't find referenced class rx.Observable$OnSubscribe
retrofit.RxSupport$2: can't find referenced class rx.Subscriber
retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPMethod
retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.URLFetchServiceFactory
retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.URLFetchService
retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPRequest
retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPHeader
retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPRequest
retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPResponse
retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPRequest
retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPResponse
retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPHeader
retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPResponse
retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPMethod
retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPRequest
retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPResponse
retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPHeader
retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPMethod
retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.URLFetchServiceFactory
retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.URLFetchService
retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPResponse
retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.URLFetchService
retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPMethod
retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.URLFetchService
retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPRequest
retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPResponse
retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.URLFetchService
retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPRequest
retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPResponse
retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.URLFetchService
retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPRequest
retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPMethod
retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPRequest
retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPResponse
retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPRequest
retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPHeader
retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPResponse
retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPRequest
retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPHeader
retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.OkHttpClient
retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.Call
retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.Request$Builder
retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.Response
retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.Request
retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.Response
retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.MediaType
retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.ResponseBody
retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.Headers
retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.OkHttpClient
retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.Request$Builder
retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.Call
retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.Request
retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.Response
retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.MediaType
retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.ResponseBody
retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.Headers
retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.OkHttpClient
retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.Request
retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.Request$Builder
retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.Response
retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.RequestBody
retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.MediaType
retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.ResponseBody
retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.Headers
retrofit.client.OkClient$1: can't find referenced class com.squareup.okhttp.RequestBody
retrofit.client.OkClient$1: can't find referenced class com.squareup.okhttp.MediaType
retrofit.client.OkClient$2: can't find referenced class com.squareup.okhttp.ResponseBody
retrofit.client.OkClient$2: can't find referenced class com.squareup.okhttp.MediaType
retrofit.client.OkClient$2: can't find referenced class com.squareup.okhttp.ResponseBody
retrofit.client.OkClient$2: can't find referenced class com.squareup.okhttp.MediaType
retrofit.client.OkClient$2: can't find referenced class com.squareup.okhttp.ResponseBody
retrofit.client.OkClient$2: can't find referenced class com.squareup.okhttp.MediaType
retrofit.client.OkClient$2: can't find referenced class com.squareup.okhttp.ResponseBody
retrofit.client.OkClient$2: can't find referenced class com.squareup.okhttp.MediaType
retrofit2.Platform$Java8: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
there were 223 unresolved references to classes or interfaces.
Problem:
First proguard time show Lint related error so me add following line in build.gradle(app) file.
After proguard time show all libraries warning message and not proguard apk (without proguard apk working good)
Changes apply both files
> build.gradle (project)
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
classpath 'com.google.gms:google-services:3.1.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
/// > 2) Build.gradle (app)
change target sdk version 27
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support:design:27.1.0'
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:there were 52 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
This happens because you enabled minify in your gradle
so add this to you proguard-rules.pro
-dontwarn com.squareup.okhttp.**
When I deploy apk in debug version there is no warning, but when I try to build apk in release version I got this warning, please anybody help.
Warning:com.jjf2017.activity.MainActivity$43$$Lambda$1: can't find referenced class java.lang.invoke.LambdaForm$Hidden
Warning:com.jjf2017.fragment.ArtistIDFragment$$Lambda$1: can't find referenced class java.lang.invoke.LambdaForm$Hidden
Warning:com.jjf2017.fragment.ArtistIDFragment$$Lambda$2: can't find referenced class java.lang.invoke.LambdaForm$Hidden
Warning:com.jjf2017.fragment.ArtistINFragment$$Lambda$1: can't find referenced class java.lang.invoke.LambdaForm$Hidden
Warning:com.jjf2017.fragment.ArtistINFragment$$Lambda$2: can't find referenced class java.lang.invoke.LambdaForm$Hidden
Warning:com.jjf2017.fragment.CcFragment$$Lambda$1: can't find referenced class java.lang.invoke.LambdaForm$Hidden
Warning:com.jjf2017.fragment.TicketFragment$$Lambda$1: can't find referenced class java.lang.invoke.LambdaForm$Hidden
Warning:org.joda.time.DateMidnight: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.DateTime: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.DateTimeZone: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.DateTimeZone: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.Days: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.Days: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.Duration: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.Hours: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.Hours: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.Instant: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.LocalDate: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.LocalDate: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.LocalDateTime: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.LocalDateTime: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.LocalTime: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.LocalTime: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.Minutes: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.Minutes: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.MonthDay: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.MonthDay: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.Months: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.Months: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.MutableDateTime: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.MutablePeriod: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.Period: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.Seconds: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.Seconds: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.Weeks: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.Weeks: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.YearMonth: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.YearMonth: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.Years: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.Years: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.base.AbstractDateTime: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.base.AbstractDuration: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.base.AbstractInstant: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.base.AbstractPeriod: can't find referenced class org.joda.convert.ToString
Warning:retrofit2.Platform$Java8: can't find referenced class java.lang.invoke.MethodHandles$Lookup
Warning:retrofit2.Platform$Java8: can't find referenced class java.lang.invoke.MethodHandle
Warning:retrofit2.Platform$Java8: can't find referenced class java.lang.invoke.MethodHandles
Warning:retrofit2.Platform$Java8: can't find referenced class java.lang.invoke.MethodHandle
Warning:retrofit2.Platform$Java8: can't find referenced class java.lang.invoke.MethodHandles$Lookup
Warning:retrofit2.Platform$Java8: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
Warning:there were 52 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
Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease' means that
you're using proguard in release.
Try to set minifyEnabled option in your build.gradle file to false.
Like this:
buildTypes {
release {
minifyEnabled false
...
}
}
if your app still working when you make
minifyEnabled false
then you have to dontwarn manually every warning that you have with -dontwarn
Exempel: -dontwarn java.lang.invoke.**
:app:proguardDebug
Warning:com.google.common.base.Absent: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.Collections2: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.Tables$UnmodifiableTable: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeBasedTable$TreeRow: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeMultimap: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeMultiset: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeMultiset$Aggregate: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeMultiset$Aggregate$1: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeMultiset$Aggregate$2: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeMultiset$AvlNode: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeMultiset$Reference: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeRangeMap: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeRangeMap$1: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeRangeMap$AsMapOfRanges: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeRangeMap$SubRangeMap: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeRangeMap$SubRangeMap$SubRangeMapAsMap$1: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeRangeSet: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeRangeSet$AsRanges: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeRangeSet$ComplementRangesByLowerBound: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeRangeSet$RangesByUpperBound: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeRangeSet$SubRangeSet: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeRangeSet$SubRangeSetRangesByLowerBound: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.package-info: can't find referenced class javax.annotation.ParametersAreNonnullByDefault
Warning:com.google.common.escape.ArrayBasedUnicodeEscaper: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.escape.Escapers$Builder: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.escape.package-info: can't find referenced class javax.annotation.ParametersAreNonnullByDefault
Warning:com.google.common.eventbus.AnnotatedSubscriberFinder$MethodIdentifier: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.eventbus.EventSubscriber: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.hash.BloomFilter: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.hash.Funnels$SequentialFunnel: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.hash.Funnels$StringCharsetFunnel: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.hash.HashCode: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.hash.Hashing$ConcatenatedHashFunction: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.hash.Murmur3_128HashFunction: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.hash.Murmur3_32HashFunction: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.hash.SipHashFunction: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.hash.package-info: can't find referenced class javax.annotation.ParametersAreNonnullByDefault
Warning:com.google.common.html.package-info: can't find referenced class javax.annotation.ParametersAreNonnullByDefault
Warning:com.google.common.io.AppendableWriter: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.io.BaseEncoding: can't find referenced class javax.annotation.CheckReturnValue
Warning:com.google.common.io.BaseEncoding$StandardBaseEncoding: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.io.CharSource: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.io.Closeables: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.io.Closer: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.io.CountingInputStream: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.io.CountingOutputStream: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.io.MultiInputStream: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.io.MultiReader: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.io.PatternFilenameFilter: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.io.package-info: can't find referenced class javax.annotation.ParametersAreNonnullByDefault
Warning:com.google.common.math.MathPreconditions: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.math.package-info: can't find referenced class javax.annotation.ParametersAreNonnullByDefault
Warning:com.google.common.net.HostAndPort: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.net.HostAndPort: can't find referenced class javax.annotation.concurrent.Immutable
Warning:com.google.common.net.HostSpecifier: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.net.InetAddresses$TeredoInfo: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.net.InternetDomainName: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.net.MediaType: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.net.MediaType: can't find referenced class javax.annotation.concurrent.Immutable
Warning:com.google.common.net.package-info: can't find referenced class javax.annotation.ParametersAreNonnullByDefault
Warning:com.google.common.primitives.Doubles: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.primitives.Floats: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.primitives.Ints: can't find referenced class javax.annotation.CheckForNull
Warning:com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator: can't find referenced class sun.misc.Unsafe
Warning:com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator$1: can't find referenced class sun.misc.Unsafe
Warning:com.google.common.primitives.UnsignedInteger: can't find referenced class javax.annotation.CheckReturnValue
Warning:com.google.common.primitives.UnsignedInteger: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.primitives.UnsignedLong: can't find referenced class javax.annotation.CheckReturnValue
Warning:com.google.common.primitives.UnsignedLong: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.primitives.package-info: can't find referenced class javax.annotation.ParametersAreNonnullByDefault
Warning:com.google.common.reflect.AbstractInvocationHandler: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.reflect.ClassPath$Scanner: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.reflect.Element: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.reflect.Invokable: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.reflect.Invokable$ConstructorInvokable: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.reflect.Invokable$MethodInvokable: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.reflect.MutableTypeToInstanceMap: can't find referenced class javax.annotation.Nullable
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
Warning:there were 1326 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
Error:Execution failed for task ':app:proguardDebug'.
> java.io.IOException: Please correct the above warnings first.
Information:BUILD FAILED
Information:Total time: 8.387 secs
Information:1 error
Information:536 warnings
Information:See complete output in console
Disable the warnings in your proguard config-
-dontwarn javax.annotation.**
The same for other warnings.
If you are pretty confident about your dependencies
You can also use:
-ignorewarnings
This proguard option will take care of all potential warnings simply by ignoring them.
I am using Parse on a project. The project uses my own Android library project which has the Parse jars in it. When I try to generate a signed apk, gradle gives the following issue:
:exampleApp:proguardRelease Warning:
com.parse.ParseOkHttpClient$CountingOkHttpRequestBody: can't find
superclass or interface com.squareup.okhttp.RequestBody Warning:
com.fasterxml.jackson.databind.ext.DOMSerializer: can't find
referenced class org.w3c.dom.bootstrap.DOMImplementationRegistry
Warning: com.fasterxml.jackson.databind.ext.DOMSerializer: can't find
referenced class org.w3c.dom.bootstrap.DOMImplementationRegistry
Warning: com.fasterxml.jackson.databind.ext.DOMSerializer: can't find
referenced class org.w3c.dom.bootstrap.DOMImplementationRegistry
Warning: com.fasterxml.jackson.databind.ext.DOMSerializer: can't find
referenced class org.w3c.dom.bootstrap.DOMImplementationRegistry
Warning: com.parse.ParseOkHttpClient: can't find referenced class
com.squareup.okhttp.OkHttpClient Warning: com.parse.ParseOkHttpClient:
can't find referenced class com.squareup.okhttp.OkHttpClient Warning:
com.parse.ParseOkHttpClient: can't find referenced class
com.squareup.okhttp.OkHttpClient Warning: com.parse.ParseOkHttpClient:
can't find referenced class com.squareup.okhttp.OkHttpClient Warning:
com.parse.ParseOkHttpClient: can't find referenced class
com.squareup.okhttp.OkHttpClient Warning: com.parse.ParseOkHttpClient:
can't find referenced class com.squareup.okhttp.OkHttpClient Warning:
com.parse.ParseOkHttpClient: can't find referenced class
com.squareup.okhttp.OkHttpClient Warning: com.parse.ParseOkHttpClient:
can't find referenced class com.squareup.okhttp.OkHttpClient Warning:
com.parse.ParseOkHttpClient: can't find referenced class
com.squareup.okhttp.Call Warning: com.parse.ParseOkHttpClient: can't
find referenced class com.squareup.okhttp.Response Warning:
com.parse.ParseOkHttpClient: can't find referenced class
com.squareup.okhttp.Response Warning: com.parse.ParseOkHttpClient:
can't find referenced class com.squareup.okhttp.ResponseBody Warning:
com.parse.ParseOkHttpClient: can't find referenced class
com.squareup.okhttp.ResponseBody Warning: com.parse.ParseOkHttpClient:
can't find referenced class com.squareup.okhttp.Response Warning:
com.parse.ParseOkHttpClient: can't find referenced class
com.squareup.okhttp.Request$Builder Warning:
com.parse.ParseOkHttpClient: can't find referenced class
com.squareup.okhttp.Request$Builder Warning:
com.parse.ParseOkHttpClient: can't find referenced class
com.squareup.okhttp.Request$Builder Warning:
com.parse.ParseOkHttpClient: can't find referenced class
com.squareup.okhttp.Request$Builder Warning:
com.parse.ParseOkHttpClient: can't find referenced class
com.squareup.okhttp.Request$Builder Warning:
com.parse.ParseOkHttpClient: can't find referenced class
com.squareup.okhttp.Headers$Builder Warning:
com.parse.ParseOkHttpClient: can't find referenced class
com.squareup.okhttp.Headers$Builder Warning:
com.parse.ParseOkHttpClient: can't find referenced class
com.squareup.okhttp.Headers$Builder Warning:
com.parse.ParseOkHttpClient: can't find referenced class
com.squareup.okhttp.Headers$Builder Warning:
com.parse.ParseOkHttpClient: can't find referenced class
com.squareup.okhttp.Request$Builder Warning:
com.parse.ParseOkHttpClient: can't find referenced class
com.squareup.okhttp.Request$Builder Warning:
com.parse.ParseOkHttpClient: can't find referenced class
com.squareup.okhttp.Request$Builder Warning:
com.parse.ParseOkHttpClient: can't find referenced class
com.squareup.okhttp.Request$Builder Warning:
com.parse.ParseOkHttpClient: can't find referenced class
com.squareup.okhttp.Response Warning: com.parse.ParseOkHttpClient:
can't find referenced class com.squareup.okhttp.Request$Builder
Warning: com.parse.ParseOkHttpClient: can't find referenced class
com.squareup.okhttp.Headers$Builder Warning:
com.parse.ParseOkHttpClient: can't find referenced class
com.squareup.okhttp.Headers Warning: com.parse.ParseOkHttpClient:
can't find referenced class com.squareup.okhttp.Call Warning:
com.parse.ParseOkHttpClient: can't find referenced class
com.squareup.okhttp.ResponseBody Warning: com.parse.ParseOkHttpClient:
can't find referenced class com.squareup.okhttp.Request Warning:
com.parse.ParseOkHttpClient: can't find referenced class
com.squareup.okhttp.Headers Warning: com.parse.ParseOkHttpClient:
can't find referenced class com.squareup.okhttp.OkHttpClient Warning:
com.parse.ParseOkHttpClient: can't find referenced class
com.squareup.okhttp.Request Warning: com.parse.ParseOkHttpClient:
can't find referenced class com.squareup.okhttp.Call Warning:
com.parse.ParseOkHttpClient: can't find referenced class
com.squareup.okhttp.Response Warning: com.parse.ParseOkHttpClient:
can't find referenced class com.squareup.okhttp.Call Warning:
com.parse.ParseOkHttpClient: can't find referenced class
com.squareup.okhttp.Call Warning: com.parse.ParseOkHttpClient: can't
find referenced class com.squareup.okhttp.Response Warning:
com.parse.ParseOkHttpClient: can't find referenced class
com.squareup.okhttp.Response Warning: com.parse.ParseOkHttpClient:
can't find referenced class com.squareup.okhttp.Request Warning:
com.parse.ParseOkHttpClient: can't find referenced class
com.squareup.okhttp.Request$Builder Warning:
com.parse.ParseOkHttpClient: can't find referenced class
com.squareup.okhttp.Headers$Builder Warning:
com.parse.ParseOkHttpClient: can't find referenced class
com.squareup.okhttp.Headers Warning: com.parse.ParseOkHttpClient:
can't find referenced class com.squareup.okhttp.Request Warning:
com.parse.ParseOkHttpClient: can't find referenced class
com.squareup.okhttp.Response Warning: com.parse.ParseOkHttpClient$1:
can't find referenced class com.squareup.okhttp.Call Warning:
com.parse.ParseOkHttpClient$1: can't find referenced class
com.squareup.okhttp.Call Warning: com.parse.ParseOkHttpClient$1: can't
find referenced class com.squareup.okhttp.Call Warning:
com.parse.ParseOkHttpClient$1: can't find referenced class
com.squareup.okhttp.Call Warning:
com.parse.ParseOkHttpClient$CountingOkHttpRequestBody: can't find
referenced class com.squareup.okhttp.RequestBody Warning:
com.parse.ParseOkHttpClient$CountingOkHttpRequestBody: can't find
referenced class com.squareup.okhttp.MediaType Warning:
com.parse.ParseOkHttpClient$CountingOkHttpRequestBody: can't find
referenced class okio.BufferedSink Warning:
com.parse.ParseOkHttpClient$CountingOkHttpRequestBody: can't find
referenced class com.squareup.okhttp.RequestBody Warning:
com.parse.ParseOkHttpClient$CountingOkHttpRequestBody: can't find
referenced class com.squareup.okhttp.MediaType Warning:
com.parse.ParseOkHttpClient$CountingOkHttpRequestBody: can't find
referenced class okio.BufferedSink Warning:
com.parse.ParseOkHttpClient$CountingOkHttpRequestBody: can't find
referenced class com.squareup.okhttp.MediaType Warning:
com.parse.ParseOkHttpClient$CountingOkHttpRequestBody: can't find
referenced class okio.BufferedSink Warning:
com.parse.ParseOkHttpClient$CountingOkHttpRequestBody: can't find
referenced class okio.BufferedSink Warning: there were 67 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)
:exampleApp:proguardRelease FAILED
FAILURE: Build failed with an exception.
Edit:
Per #karama's suggestion, I added this to my proguard rules:
-keepattributes *Annotation*
-keepattributes Signature
-dontwarn com.squareup.**
-keep class com.squareup.** { *; }
-dontwarn com.parse.ParseOkHttpClient**
-keep class com.parse.ParseOkHttpClient** { *; }
# Proguard configuration for Jackson 2.x (fasterxml package instead of codehaus package)
-keep class com.fasterxml.jackson.databind.ObjectMapper {
public <methods>;
protected <methods>;
}
-keep class com.fasterxml.jackson.databind.ObjectWriter {
public ** writeValueAsString(**);
}
-dontwarn org.w3c.dom.bootstrap.DOMImplementationRegistry
Yet, now I get the following:
Warning: com.fasterxml.jackson.databind.ext.DOMSerializer: can't find
referenced class org.w3c.dom.bootstrap.DOMImplementationRegistry
Warning: com.fasterxml.jackson.databind.ext.DOMSerializer: can't find
referenced class org.w3c.dom.bootstrap.DOMImplementationRegistry
Warning: com.fasterxml.jackson.databind.ext.DOMSerializer: can't find
referenced class org.w3c.dom.bootstrap.DOMImplementationRegistry
Warning: com.fasterxml.jackson.databind.ext.DOMSerializer: can't find
referenced class org.w3c.dom.bootstrap.DOMImplementationRegistry
Warning: com.fasterxml.jackson.databind.ext.DOMSerializer: can't find
referenced class org.w3c.dom.bootstrap.DOMImplementationRegistry
Warning: there were 5 unresolved references to classes or interfaces.
If I fix it with adding:
-dontwarn org.w3c.dom.bootstrap.DOMImplementationRegistry
When the app runs, it crashes. I saw this issue here but with no resolution: https://stackoverflow.com/a/11249755/197127
Running the app with -dontobfuscate works fine.
The error is not of parse sdk, it occures because of okHttp. Add below lines in your proguard.
-keepattributes *Annotation*
-keepattributes Signature
-dontwarn com.squareup.**
-keep class com.squareup.** { *; }
Edit
for com.fasterxml.jackson add below code :
-keep class com.fasterxml.jackson.databind.ObjectMapper {
public <methods>;
protected <methods>;
}
-keep class com.fasterxml.jackson.databind.ObjectWriter {
public ** writeValueAsString(**);
}
reference : https://github.com/krschultz/android-proguard-snippets/issues/19