Android Proguard errors on compile - android

I'm using proguard for the first time, and when I compiled the app I received the following error stack:
Note: there were 1 duplicate class definitions.
(http://proguard.sourceforge.net/manual/troubleshooting.html#duplicateclass)
Warning:org.codehaus.jackson.map.ext.DOMSerializer: can't find referenced class org.w3c.dom.bootstrap.DOMImplementationRegistry
Warning:org.codehaus.jackson.map.ext.JodaDeserializers: can't find referenced class org.joda.time.DateTime
Warning:org.codehaus.jackson.map.ext.JodaDeserializers: can't find referenced class org.joda.time.ReadableDateTime
Warning:org.codehaus.jackson.map.ext.JodaDeserializers: can't find referenced class org.joda.time.ReadableInstant
Warning:org.codehaus.jackson.map.ext.JodaDeserializers$DateMidnightDeserializer: can't find referenced class org.joda.time.DateMidnight
Warning:org.codehaus.jackson.map.ext.JodaDeserializers$DateMidnightDeserializer: can't find referenced class org.joda.time.DateTime
Warning:org.codehaus.jackson.map.ext.JodaDeserializers$DateMidnightDeserializer: can't find referenced class org.joda.time.DateMidnight
Warning:org.codehaus.jackson.map.ext.JodaDeserializers$DateMidnightDeserializer: can't find referenced class org.joda.time.DateTime
Warning:org.codehaus.jackson.map.ext.JodaDeserializers$DateMidnightDeserializer: can't find referenced class org.joda.time.DateMidnight
Warning:org.codehaus.jackson.map.ext.JodaDeserializers$DateTimeDeserializer: can't find referenced class org.joda.time.DateTime
Warning:org.codehaus.jackson.map.ext.JodaDeserializers$DateTimeDeserializer: can't find referenced class org.joda.time.DateTimeZone
Warning:org.codehaus.jackson.map.ext.JodaDeserializers$DateTimeDeserializer: can't find referenced class org.joda.time.DateTime
Warning:org.codehaus.jackson.map.ext.JodaDeserializers$DateTimeDeserializer: can't find referenced class org.joda.time.ReadableInstant
Warning:org.codehaus.jackson.map.ext.JodaDeserializers$JodaDeserializer: can't find referenced class org.joda.time.format.DateTimeFormatter
Warning:org.codehaus.jackson.map.ext.JodaDeserializers$JodaDeserializer: can't find referenced class org.joda.time.format.ISODateTimeFormat
Warning:org.codehaus.jackson.map.ext.JodaDeserializers$JodaDeserializer: can't find referenced class org.joda.time.format.DateTimeFormatter
Warning:org.codehaus.jackson.map.ext.JodaDeserializers$JodaDeserializer: can't find referenced class org.joda.time.DateTime
Warning:org.codehaus.jackson.map.ext.JodaDeserializers$LocalDateDeserializer: can't find referenced class org.joda.time.LocalDate
Warning:org.codehaus.jackson.map.ext.JodaDeserializers$LocalDateDeserializer: can't find referenced class org.joda.time.DateTime
Warning:org.codehaus.jackson.map.ext.JodaDeserializers$LocalDateDeserializer: can't find referenced class org.joda.time.LocalDate
Warning:org.codehaus.jackson.map.ext.JodaDeserializers$LocalDateDeserializer: can't find referenced class org.joda.time.DateTime
Warning:org.codehaus.jackson.map.ext.JodaDeserializers$LocalDateDeserializer: can't find referenced class org.joda.time.LocalDate
Warning:org.codehaus.jackson.map.ext.JodaDeserializers$LocalDateTimeDeserializer: can't find referenced class org.joda.time.LocalDateTime
Warning:org.codehaus.jackson.map.ext.JodaDeserializers$LocalDateTimeDeserializer: can't find referenced class org.joda.time.DateTime
Warning:org.codehaus.jackson.map.ext.JodaDeserializers$LocalDateTimeDeserializer: can't find referenced class org.joda.time.LocalDateTime
Warning:org.codehaus.jackson.map.ext.JodaDeserializers$LocalDateTimeDeserializer: can't find referenced class org.joda.time.DateTime
Warning:org.codehaus.jackson.map.ext.JodaDeserializers$LocalDateTimeDeserializer: can't find referenced class org.joda.time.LocalDateTime
Warning:org.codehaus.jackson.map.ext.JodaSerializers: can't find referenced class org.joda.time.DateTime
Warning:org.codehaus.jackson.map.ext.JodaSerializers: can't find referenced class org.joda.time.LocalDateTime
Warning:org.codehaus.jackson.map.ext.JodaSerializers: can't find referenced class org.joda.time.LocalDate
Warning:org.codehaus.jackson.map.ext.JodaSerializers: can't find referenced class org.joda.time.DateMidnight
Warning:org.codehaus.jackson.map.ext.JodaSerializers$DateMidnightSerializer: can't find referenced class org.joda.time.DateMidnight$Property
Warning:org.codehaus.jackson.map.ext.JodaSerializers$DateMidnightSerializer: can't find referenced class org.joda.time.DateMidnight
Warning:org.codehaus.jackson.map.ext.JodaSerializers$DateMidnightSerializer: can't find referenced class org.joda.time.DateMidnight$Property
Warning:org.codehaus.jackson.map.ext.JodaSerializers$DateMidnightSerializer: can't find referenced class org.joda.time.DateMidnight
Warning:org.codehaus.jackson.map.ext.JodaSerializers$DateTimeSerializer: can't find referenced class org.joda.time.DateTime
Warning:org.codehaus.jackson.map.ext.JodaSerializers$JodaSerializer: can't find referenced class org.joda.time.format.DateTimeFormatter
Warning:org.codehaus.jackson.map.ext.JodaSerializers$JodaSerializer: can't find referenced class org.joda.time.format.ISODateTimeFormat
Warning:org.codehaus.jackson.map.ext.JodaSerializers$JodaSerializer: can't find referenced class org.joda.time.format.DateTimeFormatter
Warning:org.codehaus.jackson.map.ext.JodaSerializers$JodaSerializer: can't find referenced class org.joda.time.ReadablePartial
Warning:org.codehaus.jackson.map.ext.JodaSerializers$JodaSerializer: can't find referenced class org.joda.time.ReadableInstant
Warning:org.codehaus.jackson.map.ext.JodaSerializers$LocalDateSerializer: can't find referenced class org.joda.time.LocalDate$Property
Warning:org.codehaus.jackson.map.ext.JodaSerializers$LocalDateSerializer: can't find referenced class org.joda.time.LocalDate
Warning:org.codehaus.jackson.map.ext.JodaSerializers$LocalDateSerializer: can't find referenced class org.joda.time.LocalDate$Property
Warning:org.codehaus.jackson.map.ext.JodaSerializers$LocalDateSerializer: can't find referenced class org.joda.time.LocalDate
Warning:org.codehaus.jackson.map.ext.JodaSerializers$LocalDateTimeSerializer: can't find referenced class org.joda.time.LocalDateTime$Property
Warning:org.codehaus.jackson.map.ext.JodaSerializers$LocalDateTimeSerializer: can't find referenced class org.joda.time.LocalDateTime
Warning:org.codehaus.jackson.map.ext.JodaSerializers$LocalDateTimeSerializer: can't find referenced class org.joda.time.LocalDateTime$Property
Warning:org.codehaus.jackson.map.ext.JodaSerializers$LocalDateTimeSerializer: can't find referenced class org.joda.time.LocalDateTime
Warning:there were 99 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
I tried with both the basic changes to proguard-rules.txt and with everything in that file commented out and get the same result, so the contents of that (or lack thereof) don't seem to have any bearing on this error being thrown.
As you can see, there isn't anything pointing to what exactly is duplicate. Also, the warning lines below the message about duplication reference a package I don't use anywhere in my app.
I've tried searching for this problem and attempted to add some lines such as
-keep class android.support.v4.** { *; }
which someone suggested but that didn't do the trick.
Here is something in the build.gradle file for my app which is raising a flag:
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
I have a file proguard-rules.txt in the root folder of my app (the same directory as my build.gradle file), but I don't have a proguard-android.txt file there, or anywhere else I could find for that matter. Could that be a cause?
Any ideas? Thanks!

You actually don't have any errors, these are warnings which, according to what the log says,
If your code works fine without the missing classes, you can suppress
the warnings with '-dontwarn' options.
can be suppressed with the following line in the ProGuard config:
-dontwarn org.codehaus.jackson.map.ext.**

Add on your PROGuard file:
-dontwarn org.joda.convert.**
-dontwarn org.codehaus.jackson.map.ext.**
-keep class org.w3c.dom.bootstrap.** { *; }
-keep class org.joda.time.** { *; }

Try adding the following to your proguard config:
-keep class org.w3c.dom.bootstrap.** { *; }
-keep class org.joda.time.** { *; }

Related

Getting com.loopj.android.http.AsyncHttpClient after enabling Proguard

I have read this, It looks like its a known issue from quite some time. But i was not receiving any warning or crash when i was not using pro-guard. After enabling it, I am receiving around 500 warnings like following;
Warning:com.loopj.android.http.AsyncHttpClient: can't find referenced
class cz.msebera.android.httpclient
I have tried following, but still all of the warnings are there.
android {
compileSdkVersion 24
buildToolsVersion "24.0.3"
useLibrary 'org.apache.http.legacy'
}
I am not using http-client library, but there may be some other library that I am using in my project is using this.
Warnings
Warning:com.loopj.android.http.RangeFileAsyncHttpResponseHandler: can't find referenced class cz.msebera.android.httpclient.HttpResponse
Warning:com.loopj.android.http.RangeFileAsyncHttpResponseHandler: can't find referenced class cz.msebera.android.httpclient.Header
Warning:com.loopj.android.http.RangeFileAsyncHttpResponseHandler: can't find referenced class cz.msebera.android.httpclient.StatusLine
Warning:com.loopj.android.http.RangeFileAsyncHttpResponseHandler: can't find referenced class cz.msebera.android.httpclient.HttpResponse
Warning:com.loopj.android.http.RangeFileAsyncHttpResponseHandler: can't find referenced class cz.msebera.android.httpclient.HttpEntity
Warning:com.loopj.android.http.RangeFileAsyncHttpResponseHandler: can't find referenced class cz.msebera.android.httpclient.client.methods.HttpUriRequest
Warning:com.loopj.android.http.RequestParams: can't find referenced class cz.msebera.android.httpclient.protocol.HTTP
Warning:com.loopj.android.http.RequestParams: can't find referenced class cz.msebera.android.httpclient.message.BasicNameValuePair
Warning:com.loopj.android.http.RequestParams: can't find referenced class cz.msebera.android.httpclient.client.entity.UrlEncodedFormEntity
Warning:com.loopj.android.http.RequestParams: can't find referenced class cz.msebera.android.httpclient.message.BasicNameValuePair
Warning:com.loopj.android.http.RequestParams: can't find referenced class cz.msebera.android.httpclient.client.utils.URLEncodedUtils
Warning:com.loopj.android.http.RequestParams: can't find referenced class cz.msebera.android.httpclient.message.BasicNameValuePair
Warning:com.loopj.android.http.RequestParams: can't find referenced class cz.msebera.android.httpclient.client.utils.URLEncodedUtils
Warning:com.loopj.android.http.RequestParams: can't find referenced class cz.msebera.android.httpclient.message.BasicNameValuePair
Warning:com.loopj.android.http.RequestParams: can't find referenced class cz.msebera.android.httpclient.HttpEntity
Warning:com.loopj.android.http.RequestParams: can't find referenced class cz.msebera.android.httpclient.message.BasicNameValuePair
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.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
Warning:library class android.webkit.WebView depends on program class android.net.http.SslCertificate
Warning:library class android.webkit.WebViewClient depends on program class android.net.http.SslError
Warning:library class org.apache.http.conn.ssl.SSLSocketFactory depends on program class org.apache.http.conn.scheme.HostNameResolver
Warning:library class org.apache.http.conn.ssl.SSLSocketFactory depends on program class org.apache.http.params.HttpParams
Warning:library class org.apache.http.params.HttpConnectionParams depends on program class org.apache.http.params.HttpParams
Warning:there were 757 unresolved references to classes or interfaces.
Warning:there were 18 instances of library classes depending on program classes.
Warning:there were 8 unresolved references to program class members.
Warning:there were 2 unresolved references to library class members.
After adding the lines provided in Hitesh Gehlot answer. I am receiving these 5 warnings.
Information:Gradle tasks [:app:assembleRelease]
Warning:com.algolia.search.saas.APIClient: can't find referenced method 'org.json.JSONObject put(java.lang.String,java.util.Collection)' in library class org.json.JSONObject
Warning:com.algolia.search.saas.Index: can't find referenced method 'org.json.JSONObject put(java.lang.String,java.util.Collection)' in library class org.json.JSONObject
Warning:library class android.webkit.WebView depends on program class android.net.http.SslCertificate
Warning:library class android.webkit.WebViewClient depends on program class android.net.http.SslError
Warning:there were 3 instances of library classes depending on program classes.
Warning:there were 2 unresolved references to library class members.
Warning:Exception while processing task java.io.IOException: Please correct the above warnings first.
Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
> java.io.IOException: Please correct the above warnings first.
paste these lines in proguard-rules.pro file
-dontwarn com.loopj.android.http.**
-dontwarn org.apache.http.**
-dontwarn rx.internal.util.**

Proguard causes 100 "can't find referenced class" warnings, ignores keep rules for springframework and jackson

My code compiles and runs fine in debug mode, but once I use a build configuration with minifyEnabled true I get these warnings which prevent compilation:
Warning:there were 100 unresolved references to classes or interfaces.
Warning:there were 2 unresolved references to program class members.
For readabilities sake I'll include the full output at the bottom.
There are two libraries that are causing these warnings, springframework and jackson. Those libraries are included in my project via gradle like so:
compile 'com.fasterxml.jackson.core:jackson-annotations:2.8.5'
compile 'com.fasterxml.jackson.core:jackson-core:2.8.5'
compile 'com.fasterxml.jackson.core:jackson-databind:2.8.5'
apt "org.androidannotations:rest-spring:$AAVersion"
compile "org.androidannotations:rest-spring-api:$AAVersion"
compile 'org.springframework.android:spring-android-rest-template:2.0.0.M3'
If I use -dontwarn for both of these libraries, like many people suggest for these types of issues, the app compiles but crashes with an obfuscated crashlog during startup - I tried retracing it with the mapping file, but that's not working either - I'm reasonably certain that the app crashes due to the autogenerated (through android annotations) class RestClient_ when initializing a jackson mapping class, the exception is the following:
java.lang.NoSuchFieldError: No static field PUBLIC_ONLY of type
Lcom/myapp/app/mv$a; in class Lcom/myapp/app/mv$a; or its superclasses
(declaration of 'com.myapp.app.mv$a' appears in
/data/app/com.myapp.app-1/base.apk)
Although on a different phone, the exception has no message. It's pretty obvious that this is a result of proguard.
My full proguard file can be found here https://gist.github.com/Syzygy2048/02a44032611d40720bad36b5e3b37db6
Here are a couple of things I already tried (I tried more, but I only started writing things down after a while). The attempts focus on fixing springframework first. (Had to put this in a gist because stackoverflow wouldn't let me post otherwise)
https://gist.github.com/Syzygy2048/f1bdabc9f2ea091aa8faec67c62dd8bb
full error log:
Information:Gradle tasks [:myappApp:assembleMyappPublicRelease]
Warning:org.springframework.core.convert.support.ConvertingPropertyEditorAdapter: can't find superclass or interface java.beans.PropertyEditorSupport
Warning:com.fasterxml.jackson.databind.ext.DOMSerializer: can't find referenced class org.w3c.dom.bootstrap.DOMImplementationRegistry
Warning:com.fasterxml.jackson.databind.ext.Java7SupportImpl: can't find referenced class java.beans.Transient
Warning:com.fasterxml.jackson.databind.ext.Java7SupportImpl: can't find referenced class java.beans.ConstructorProperties
Warning:com.fasterxml.jackson.databind.ext.Java7SupportImpl: can't find referenced class java.nio.file.Path
Warning:com.fasterxml.jackson.databind.ext.Java7SupportImpl: can't find referenced class java.beans.Transient
Warning:com.fasterxml.jackson.databind.ext.Java7SupportImpl: can't find referenced class java.beans.ConstructorProperties
Warning:com.fasterxml.jackson.databind.ext.Java7SupportImpl: can't find referenced class java.beans.Transient
Warning:com.fasterxml.jackson.databind.ext.Java7SupportImpl: can't find referenced class java.beans.ConstructorProperties
Warning:com.fasterxml.jackson.databind.ext.Java7SupportImpl: can't find referenced class java.beans.Transient
Warning:com.fasterxml.jackson.databind.ext.Java7SupportImpl: can't find referenced class java.beans.ConstructorProperties
Warning:com.fasterxml.jackson.databind.ext.NioPathDeserializer: can't find referenced class java.nio.file.Path
Warning:com.fasterxml.jackson.databind.ext.NioPathDeserializer: can't find referenced class java.nio.file.Paths
Warning:com.fasterxml.jackson.databind.ext.NioPathDeserializer: can't find referenced class java.nio.file.Path
Warning:com.fasterxml.jackson.databind.ext.NioPathSerializer: can't find referenced class java.nio.file.Path
Warning:org.springframework.core.convert.support.ConvertingPropertyEditorAdapter: can't find referenced class java.beans.PropertyEditorSupport
Warning:org.springframework.core.convert.support.ConvertingPropertyEditorAdapter: can't find referenced method 'void setValue(java.lang.Object)' in program class org.springframework.core.convert.support.ConvertingPropertyEditorAdapter
Warning:org.springframework.core.convert.support.ConvertingPropertyEditorAdapter: can't find referenced method 'java.lang.Object getValue()' in program class org.springframework.core.convert.support.ConvertingPropertyEditorAdapter
Warning:org.springframework.core.convert.support.ConvertingPropertyEditorAdapter: can't find referenced class java.beans.PropertyEditorSupport
Warning:org.springframework.http.client.HttpComponentsClientHttpRequest: can't find referenced class org.apache.http.entity.ByteArrayEntityHC4
Warning:org.springframework.http.client.HttpComponentsClientHttpRequest: can't find referenced class org.apache.http.impl.client.CloseableHttpClient
Warning:org.springframework.http.client.HttpComponentsClientHttpRequest: can't find referenced class org.apache.http.client.methods.CloseableHttpResponse
Warning:org.springframework.http.client.HttpComponentsClientHttpRequestFactory: can't find referenced class org.apache.http.impl.client.HttpClients
Warning:org.springframework.http.client.HttpComponentsClientHttpRequestFactory: can't find referenced class org.apache.http.impl.client.CloseableHttpClient
Warning:org.springframework.http.client.HttpComponentsClientHttpRequestFactory: can't find referenced class org.apache.http.client.protocol.HttpClientContext
Warning:org.springframework.http.client.HttpComponentsClientHttpRequestFactory: can't find referenced class org.apache.http.client.methods.Configurable
Warning:org.springframework.http.client.HttpComponentsClientHttpRequestFactory: can't find referenced class org.apache.http.client.config.RequestConfig
Warning:org.springframework.http.client.HttpComponentsClientHttpRequestFactory: can't find referenced class org.apache.http.client.config.RequestConfig$Builder
Warning:org.springframework.http.client.HttpComponentsClientHttpRequestFactory: can't find referenced class org.apache.http.client.config.RequestConfig
Warning:org.springframework.http.client.HttpComponentsClientHttpRequestFactory: can't find referenced class org.apache.http.client.methods.HttpGetHC4
Warning:org.springframework.http.client.HttpComponentsClientHttpRequestFactory: can't find referenced class org.apache.http.client.methods.HttpDeleteHC4
Warning:org.springframework.http.client.HttpComponentsClientHttpRequestFactory: can't find referenced class org.apache.http.client.methods.HttpHeadHC4
Warning:org.springframework.http.client.HttpComponentsClientHttpRequestFactory: can't find referenced class org.apache.http.client.methods.HttpOptionsHC4
Warning:org.springframework.http.client.HttpComponentsClientHttpRequestFactory: can't find referenced class org.apache.http.client.methods.HttpPostHC4
Warning:org.springframework.http.client.HttpComponentsClientHttpRequestFactory: can't find referenced class org.apache.http.client.methods.HttpPutHC4
Warning:org.springframework.http.client.HttpComponentsClientHttpRequestFactory: can't find referenced class org.apache.http.client.methods.HttpTraceHC4
Warning:org.springframework.http.client.HttpComponentsClientHttpRequestFactory: can't find referenced class org.apache.http.client.methods.HttpPatch
Warning:org.springframework.http.client.HttpComponentsClientHttpRequestFactory: can't find referenced class org.apache.http.impl.client.CloseableHttpClient
Warning:org.springframework.http.client.HttpComponentsClientHttpRequestFactory: can't find referenced class org.apache.http.client.config.RequestConfig
Warning:org.springframework.http.client.HttpComponentsClientHttpRequestFactory: can't find referenced class org.apache.http.impl.client.HttpClients
Warning:org.springframework.http.client.HttpComponentsClientHttpRequestFactory: can't find referenced class org.apache.http.client.protocol.HttpClientContext
Warning:org.springframework.http.client.HttpComponentsClientHttpRequestFactory: can't find referenced class org.apache.http.client.config.RequestConfig
Warning:org.springframework.http.client.HttpComponentsClientHttpRequestFactory: can't find referenced class org.apache.http.client.config.RequestConfig$Builder
Warning:org.springframework.http.client.HttpComponentsClientHttpRequestFactory: can't find referenced class org.apache.http.impl.client.CloseableHttpClient
Warning:org.springframework.http.client.HttpComponentsClientHttpRequestFactory: can't find referenced class org.apache.http.client.config.RequestConfig
Warning:org.springframework.http.client.HttpComponentsClientHttpRequestFactory: can't find referenced class org.apache.http.impl.client.CloseableHttpClient
Warning:org.springframework.http.client.HttpComponentsClientHttpResponse: can't find referenced class org.apache.http.client.methods.CloseableHttpResponse
Warning:org.springframework.http.client.HttpComponentsClientHttpResponse: can't find referenced class org.apache.http.util.EntityUtilsHC4
Warning:org.springframework.http.client.HttpComponentsClientHttpResponse: can't find referenced class org.apache.http.client.methods.CloseableHttpResponse
Warning:org.springframework.http.client.HttpComponentsClientHttpResponse: can't find referenced class org.apache.http.util.EntityUtilsHC4
Warning:org.springframework.http.client.HttpComponentsClientHttpResponse: can't find referenced class org.apache.http.client.methods.CloseableHttpResponse
Warning:org.springframework.http.client.HttpComponentsStreamingClientHttpRequest: can't find referenced class org.apache.http.impl.client.CloseableHttpClient
Warning:org.springframework.http.client.HttpComponentsStreamingClientHttpRequest: can't find referenced class org.apache.http.client.methods.CloseableHttpResponse
Warning:org.springframework.http.converter.xml.SimpleXmlHttpMessageConverter: can't find referenced class org.simpleframework.xml.core.Persister
Warning:org.springframework.http.converter.xml.SimpleXmlHttpMessageConverter: can't find referenced class org.simpleframework.xml.Root
Warning:org.springframework.http.converter.xml.SimpleXmlHttpMessageConverter: can't find referenced class org.simpleframework.xml.Serializer
Warning:there were 100 unresolved references to classes or interfaces.
Warning:there were 2 unresolved references to program class members.
Warning:Exception while processing task java.io.IOException: Please correct the above warnings first.
Error:Execution failed for task ':myappApp:transformClassesAndResourcesWithProguardForMyappPublicRelease'.
Job failed, see logs for details
Information:BUILD FAILED
Information:Total time: 23.68 secs
Information:1 error
Information:59 warnings
Information:See complete output in console
It turns out that adding this to my proguard file fixed my issues.
-keepclassmembers class com.myapp.models.** {
*; }
-keep class com.fasterxml.jackson.annotation.** { *; }
-dontwarn com.fasterxml.jackson.databind.**
-dontwarn org.springframework.**
So in the end I could ignore most of those warnings after all. As I said simply ignoring them lead to crashes, which are fixed by not obfuscating jackson annotations and by not obfuscating my model classes which seem to be needed so that the json <--> pojo conversion can happen.

Android proguard crashed when Azure mobile app is used

I use Azure mobile app in my new Android project.
When I run the app on debug mode, the Mobile app works successfully and I can see my new records in my table.
My problem is starting when I creates an apk file with proguard.
I am sorry to say that I am newbie on Proguard then I can not solve my Proguard problems even I read the documentation at offical Proguard page.
So, I get these errors when I try to create apk file with Proguard without any Proguard code.
Warning: com.google.common.base.Absent: can't find referenced class javax.annotation.Nullable
Warning: com.google.common.base.Absent: can't find referenced class javax.annotation.Nullable
Warning: com.google.common.base.Ascii: can't find referenced class javax.annotation.CheckReturnValue
Warning: com.google.common.base.CaseFormat$StringConverter: can't find referenced class javax.annotation.Nullable
Warning: com.google.common.base.CharMatcher: can't find referenced class javax.annotation.CheckReturnValue
Warning: com.google.common.base.CharMatcher: can't find referenced class javax.annotation.CheckReturnValue
Warning: com.google.common.base.CharMatcher: can't find referenced class javax.annotation.CheckReturnValue
and more hundreads line...
Warning: com.google.common.cache.Striped64: can't find referenced class sun.misc.Unsafe
Warning: com.google.common.cache.Striped64: can't find referenced class sun.misc.Unsafe
Warning: com.google.common.cache.Striped64: can't find referenced class sun.misc.Unsafe
Warning: com.google.common.cache.Striped64: can't find referenced class sun.misc.Unsafe
Warning: com.google.common.cache.Striped64$1: can't find referenced class sun.misc.Unsafe
Warning: com.google.common.cache.Striped64$1: can't find referenced class sun.misc.Unsafe
Warning: com.google.common.cache.Striped64$1: can't find referenced class sun.misc.Unsafe
Warning: com.google.common.cache.Striped64$1: can't find referenced class sun.misc.Unsafe
and more hundreads line....
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
Then I added these line in my proguard.
-keep class okio.** { *; }
-dontwarn okio.**
-keep class com.fasterxml.** { *; }
-dontwarn com.fasterxml.**
-dontwarn javax.annotation.**
-dontwarn javax.inject.**
-dontwarn sun.misc.Unsafe
-keep class com.microsoft.windowsazure.mobileservices.** { *; }
-dontwarn android.os.**
-dontwarn com.microsoft.windowsazure.mobileservices.RequestAsyncTask
After that, Android studio created the apk however The app crahsed as soon as It started. Then I investigate the logs, I saw new warnings that color are white.
Note: duplicate definition of library class [org.apache.http.conn.scheme.LayeredSocketFactory]
Note: duplicate definition of library class [org.apache.http.conn.scheme.SocketFactory]
Note: duplicate definition of library class [org.apache.http.conn.scheme.HostNameResolver]
Note: duplicate definition of library class [org.apache.http.conn.ConnectTimeoutException]
Note: duplicate definition of library class [org.apache.http.params.CoreConnectionPNames]
Note: duplicate definition of library class [org.apache.http.params.HttpParams]
Note: duplicate definition of library class [org.apache.http.params.HttpConnectionParams]
Note: duplicate definition of library class [android.net.http.SslError]
Note: duplicate definition of library class [android.net.http.HttpResponseCache]
Note: duplicate definition of library class [android.net.http.SslCertificate$DName]
Note: duplicate definition of library class [android.net.http.SslCertificate]
Note: there were 11 duplicate class definitions.
(http://proguard.sourceforge.net/manual/troubleshooting.html#duplicateclass)
Thanks for help.
#MustafaOlkun, It seems that the solutions for your issues can be found at the troubleshooting page of ProGuard.
For the issue Warning: can't find referenced class, please see http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass.
For the issue Note: duplicate definition of library class, please see http://proguard.sourceforge.net/manual/troubleshooting.html#duplicateclass.
Hope it helps.

How to solve Can't find referenced class warnings when building for Amazon?

Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
java.io.IOException: Please correct the above warnings first.
Here are the dependencies of my build.gradle
dependencies {
compile project(':chartboostSDK')
compile project(':flurry_lib')
compile project(':googleCloudMessaging_lib')
compile project(':mainLibProj')
compile project(':localytics_lib')
compile project(':mobihelp_sdk_android_v1534')
compile project(':unityandroidresources')
compile project(':iAB_lib')
compile project(':etcetera_lib')
compile 'com.google.code.gson:gson:2.3.1'
compile 'com.google.android.gms:play-services:+'
compile files('libs/FlurryPlugin.jar')
compile files('libs/FreshdeskPlugin.jar')
compile files('libs/Prime31UnityActivity.jar')
compile files('libs/adcolony-adapter-1.1.6.jar')
compile files('libs/android-bridge.jar')
compile files('libs/apsalar.jar')
compile files('libs/apsalarUnity3d.jar')
compile files('libs/bolts-android-1.2.1.jar')
compile files('libs/chartboost-adapter-1.0.6.jar')
compile files('libs/crittercism_v5_4_3_sdkonly.jar')
compile files('libs/dagger.jar')
compile files('libs/emojiplugin.jar')
compile files('libs/in-app-purchasing-2.0.61.jar')
compile files('libs/javax.inject.jar')
compile files('libs/mediationsdk-6.3.5.jar')
compile files('libs/nativex-adapter-1.0.3.jar')
compile files('libs/nineoldandroids.jar')
compile 'com.android.support:support-annotations:23.1.1'
compile files('libs/tapjoyconnectlibrary.jar')
compile files('libs/tapjoyunitywrapper.jar')
compile files('libs/unity-classes.jar')
compile files('libs/vungle-adapter-1.1.6.jar')
compile files('libs/unity-classes.jar')
}
Here is the list of warnings
Warning:com.amazon.device.iap.internal.b.i: can't find referenced class com.amazon.android.framework.prompt.PromptContent
Warning:com.vungle.publisher.location.GoogleLocationClientDetailedLocationProvider: can't find superclass or interface com.google.android.gms.common.GooglePlayServicesClient$OnConnectionFailedListener
Warning:com.prime31.FlurryPlugin$2: can't find referenced class com.flurry.android.FlurryAgent
Warning:com.amazon.device.iap.internal.b.i: can't find referenced class com.amazon.android.framework.prompt.PromptManager
Warning:com.amazon.device.iap.internal.b.b: can't find referenced class com.amazon.android.framework.prompt.PromptContent
Warning:com.supersonic.unity.androidbridge.AndroidBridge: can't find referenced class com.supersonic.adapters.hyprmx.HyprMXConfig
Warning:com.prime31.FlurryPlugin$6: can't find referenced class com.flurry.android.FlurryAgent
Warning:com.prime31.FlurryPlugin$11: can't find referenced class com.flurry.android.FlurryAds
Warning:com.prime31.FlurryPlugin$12: can't find referenced class com.flurry.android.FlurryAds
Warning:com.amazon.device.iap.internal.b.b.a: can't find referenced class com.amazon.android.framework.context.ContextManager
Warning:com.amazon.device.iap.internal.b.c.b: can't find referenced class com.amazon.venezia.command.SuccessResult
Warning:com.amazon.device.iap.internal.b.i: can't find referenced class com.amazon.venezia.command.SuccessResult
Warning:com.amazon.device.iap.internal.b.b: can't find referenced class com.amazon.android.framework.prompt.SimplePrompt
Warning:com.amazon.device.iap.internal.b.b.a: can't find referenced class com.amazon.android.framework.task.TaskManager
Warning:com.amazon.device.iap.internal.b.b.b: can't find referenced method 'void preExecution()' in program class com.amazon.device.iap.internal.b.b.a
Warning:com.freshdeskplugin.freshdesksupport.UnitySupport: can't find referenced class com.freshdesk.mobihelp.UnreadUpdatesCallback
Warning:com.amazon.device.iap.internal.b.b.b: can't find referenced class com.amazon.android.framework.exception.KiwiException
Warning:com.freshdeskplugin.freshdesksupport.UnitySupport: can't find referenced class com.freshdesk.mobihelp.MobihelpConfig
Warning:com.amazon.device.iap.internal.b.i: can't find superclass or interface com.amazon.android.framework.task.command.AbstractCommandTask
Warning:com.freshdeskplugin.freshdesksupport.UnitySupport: can't find referenced class com.freshdesk.mobihelp.FeedbackType
Warning:com.amazon.device.iap.internal.b.h.a: can't find referenced class com.amazon.venezia.command.SuccessResult
Warning:com.amazon.device.iap.internal.b.i: can't find referenced class com.amazon.android.framework.exception.KiwiException
Warning:com.amazon.device.iap.internal.b.b.a: can't find referenced class com.amazon.android.framework.exception.KiwiException
Warning:com.vungle.publisher.location.GoogleLocationClientDetailedLocationProvider: can't find referenced class com.google.android.gms.common.GooglePlayServicesClient$OnConnectionFailedListener
Warning:com.supersonic.unity.androidbridge.AndroidBridge: can't find referenced class com.supersonic.adapters.unityads.UnityAdsConfig
Warning:com.supersonic.unity.androidbridge.AndroidBridge: can't find referenced class com.supersonic.adapters.flurry.FlurryConfig
Warning:com.prime31.FlurryPlugin$12: can't find referenced class com.flurry.android.FlurryAdSize
Warning:com.amazon.device.iap.internal.b.i: can't find referenced class com.amazon.android.framework.exception.KiwiException
Warning:com.supersonic.unity.androidbridge.AndroidBridge: can't find referenced class com.supersonic.adapters.applovin.AppLovinConfig
Warning:com.amazon.device.iap.internal.b.e.d: can't find referenced class com.amazon.android.framework.exception.KiwiException
Warning:com.prime31.FlurryPlugin: can't find referenced class com.flurry.android.FlurryAdListener
Warning:com.amazon.device.iap.internal.b.i: can't find referenced class com.amazon.android.framework.exception.KiwiException
Warning:com.freshdeskplugin.freshdesksupport.UnitySupport: can't find referenced class com.freshdesk.mobihelp.MobihelpConfig
Warning:com.prime31.FlurryPlugin: can't find referenced class com.flurry.android.FlurryAgent
Warning:com.amazon.device.iap.internal.b.a.b: can't find referenced class com.amazon.venezia.command.SuccessResult
Warning:com.amazon.device.iap.internal.b.b: can't find referenced class com.amazon.android.framework.prompt.SimplePrompt
Warning:com.amazon.device.iap.internal.b.b.a: can't find referenced class com.amazon.venezia.command.SuccessResult
Warning:com.amazon.device.iap.internal.b.i: can't find referenced class com.amazon.android.framework.task.command.AbstractCommandTask
Warning:com.prime31.FlurryPlugin: can't find superclass or interface com.flurry.android.FlurryAdListener
Warning:com.amazon.device.iap.internal.b.i: can't find referenced class com.amazon.venezia.command.SuccessResult
Warning:com.vungle.publisher.location.GoogleLocationClientDetailedLocationProvider: can't find referenced class com.google.android.gms.location.LocationClient
Warning:com.amazon.device.iap.internal.b.i: can't find referenced class com.amazon.android.Kiwi
Warning:com.amazon.device.iap.internal.b.e.c: can't find referenced class com.amazon.android.framework.exception.KiwiException
Warning:com.supersonic.unity.androidbridge.AndroidBridge: can't find referenced class com.supersonic.adapters.hyprmx.HyprMXConfig
Warning:com.amazon.device.iap.internal.b.b: can't find referenced class com.amazon.android.framework.prompt.PromptContent
Warning:com.amazon.device.iap.internal.util.a: can't find referenced class com.amazon.android.Kiwi
Warning:com.prime31.FlurryPlugin$9: can't find referenced class com.flurry.android.FlurryAdSize
Warning:com.prime31.FlurryPlugin$10: can't find referenced class com.flurry.android.FlurryAds
Warning:com.amazon.device.iap.internal.b.b: can't find referenced class com.amazon.android.framework.resource.Resource
Warning:com.vungle.publisher.location.GoogleLocationClientDetailedLocationProvider: can't find referenced class com.google.android.gms.common.GooglePlayServicesClient$ConnectionCallbacks
Warning:com.tapjoy.internal.a$g: can't find referenced method 'void setLatestEventInfo(android.content.Context,java.lang.CharSequence,java.lang.CharSequence,android.app.PendingIntent)' in library class android.app.Notification
Warning:com.amazon.device.iap.internal.b.i: can't find referenced class com.amazon.android.licensing.LicenseFailurePromptContentMapper
Warning:com.tapjoy.internal.ii: can't find referenced method 'org.apache.http.conn.ssl.SSLSocketFactory getHttpSocketFactory(int,android.net.SSLSessionCache)' in library class android.net.SSLCertificateSocketFactory
Warning:com.vungle.publisher.location.GoogleLocationClientDetailedLocationProvider: can't find superclass or interface com.google.android.gms.common.GooglePlayServicesClient$ConnectionCallbacks
Warning:com.amazon.device.iap.internal.b.b: can't find referenced class com.amazon.android.framework.context.ContextManager
Warning:com.vungle.publisher.location.GoogleLocationClientDetailedLocationProvider: can't find referenced class com.google.android.gms.common.GooglePlayServicesClient$OnConnectionFailedListener
Warning:com.amazon.device.iap.internal.b.b.a: can't find referenced class com.amazon.android.framework.task.TaskManager
Warning:com.amazon.device.iap.internal.b.g.a: can't find referenced class com.amazon.venezia.command.SuccessResult
Warning:com.amazon.device.iap.internal.b.b: can't find referenced class com.amazon.android.framework.context.ContextManager
Warning:com.amazon.device.iap.internal.b.b.a$1: can't find referenced class com.amazon.android.framework.context.ContextManager
Warning:com.supersonic.unity.androidbridge.AndroidBridge: can't find referenced class com.supersonic.adapters.applovin.AppLovinConfig
Warning:com.amazon.device.iap.internal.b.i: can't find referenced class com.amazon.android.licensing.LicenseFailurePromptContentMapper
Warning:com.freshdeskplugin.freshdesksupport.UnitySupport$1: can't find superclass or interface com.freshdesk.mobihelp.UnreadUpdatesCallback
Warning:com.tapjoy.internal.km: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
Warning:com.prime31.FlurryPlugin$1: can't find referenced class com.flurry.android.FlurryAgent
Warning:com.freshdeskplugin.freshdesksupport.UnitySupport: can't find referenced class com.freshdesk.mobihelp.FeedbackType
Warning:com.amazon.device.iap.internal.b.i: can't find referenced class com.amazon.android.Kiwi
Warning:com.prime31.FlurryPlugin$9: can't find referenced class com.flurry.android.FlurryAds
Warning:com.supersonic.unity.androidbridge.AndroidBridge: can't find referenced class com.supersonic.adapters.unityads.UnityAdsConfig
Warning:com.amazon.device.iap.internal.b.b.a: can't find referenced class com.amazon.venezia.command.SuccessResult
Warning:com.vungle.publisher.location.GoogleLocationClientDetailedLocationProvider: can't find referenced class com.google.android.gms.common.GooglePlayServicesClient
Warning:com.amazon.device.iap.internal.b.c.b: can't find referenced class com.amazon.android.framework.exception.KiwiException
Warning:com.amazon.device.iap.internal.b.b.a: can't find referenced class com.amazon.venezia.command.SuccessResult
Warning:com.freshdeskplugin.freshdesksupport.UnitySupport$1: can't find referenced class com.freshdesk.mobihelp.MobihelpCallbackStatus
Warning:com.freshdeskplugin.freshdesksupport.UnitySupport: can't find referenced class com.freshdesk.mobihelp.Mobihelp
Warning:com.amazon.device.iap.internal.b.i: can't find referenced class com.amazon.venezia.command.FailureResult
Warning:com.amazon.device.iap.internal.b.b.a: can't find referenced class com.amazon.android.framework.task.TaskManager
Warning:com.prime31.FlurryPlugin$7: can't find referenced class com.flurry.android.FlurryAgent
Warning:com.supersonic.unity.androidbridge.AndroidBridge: can't find referenced class com.supersonic.adapters.flurry.FlurryConfig
Warning:com.prime31.FlurryPlugin$10: can't find referenced class com.flurry.android.FlurryAdSize
Warning:com.amazon.device.iap.internal.b.f: can't find referenced class com.amazon.android.framework.util.KiwiLogger
Warning:com.prime31.FlurryPlugin$10: can't find referenced class com.flurry.android.FlurryAdSize
Warning:com.vungle.publisher.location.GoogleLocationClientDetailedLocationProvider: can't find referenced class com.google.android.gms.common.GooglePlayServicesClient$ConnectionCallbacks
Warning:com.tapjoy.internal.ii$1: can't find referenced method 'org.apache.http.conn.ssl.SSLSocketFactory getHttpSocketFactory(int,android.net.SSLSessionCache)' in library class android.net.SSLCertificateSocketFactory
Warning:com.freshdeskplugin.freshdesksupport.UnitySupport: can't find referenced class com.freshdesk.mobihelp.MobihelpConfig
Warning:com.amazon.device.iap.internal.b.i: can't find referenced class com.amazon.venezia.command.FailureResult
Warning:com.amazon.device.iap.internal.b.i: can't find referenced class com.amazon.android.licensing.LicenseFailurePromptContentMapper
Warning:com.prime31.FlurryPlugin$5: can't find referenced class com.flurry.android.FlurryAgent
Warning:com.freshdeskplugin.freshdesksupport.UnitySupport: can't find referenced class com.freshdesk.mobihelp.MobihelpConfig
Warning:com.amazon.device.iap.internal.b.a.a: can't find referenced class com.amazon.venezia.command.SuccessResult
Warning:com.amazon.device.iap.internal.b.b.a$1: can't find superclass or interface com.amazon.android.framework.task.Task
Warning:com.amazon.device.iap.internal.b.d.d: can't find referenced class com.amazon.venezia.command.SuccessResult
Warning:com.amazon.device.iap.internal.b.g.a: can't find referenced class com.amazon.android.framework.exception.KiwiException
Warning:com.amazon.device.iap.internal.b.c.a: can't find referenced class com.amazon.venezia.command.SuccessResult
Warning:com.amazon.device.iap.internal.b.b.a: can't find referenced class com.amazon.android.framework.task.pipeline.TaskPipelineId
Warning:com.amazon.device.iap.internal.b.f.a: can't find referenced class com.amazon.venezia.command.SuccessResult
Warning:com.tapjoy.internal.a$h: can't find referenced method 'void setLatestEventInfo(android.content.Context,java.lang.CharSequence,java.lang.CharSequence,android.app.PendingIntent)' in library class android.app.Notification
Warning:com.amazon.device.iap.internal.b.d.c: can't find referenced class com.amazon.venezia.command.SuccessResult
Warning:com.amazon.device.iap.internal.b.e.c: can't find referenced class com.amazon.venezia.command.SuccessResult
Warning:com.amazon.device.iap.internal.b.i: can't find referenced class com.amazon.venezia.command.FailureResult
Warning:com.amazon.device.iap.internal.b.b.a: can't find referenced class com.amazon.android.framework.resource.Resource
Warning:com.prime31.FlurryPlugin$12: can't find referenced class com.flurry.android.FlurryAdSize
Warning:com.amazon.device.iap.internal.b.e.d: can't find referenced class com.amazon.venezia.command.SuccessResult
Warning:com.amazon.device.iap.internal.b.b.a$1: can't find referenced class com.amazon.android.framework.task.Task
Warning:com.freshdeskplugin.freshdesksupport.UnitySupport: can't find referenced class com.freshdesk.mobihelp.Mobihelp
Warning:com.amazon.device.iap.internal.b.h.a: can't find referenced class com.amazon.android.framework.exception.KiwiException
Warning:com.prime31.FlurryPlugin$9: can't find referenced class com.flurry.android.FlurryAdSize
Warning:com.prime31.FlurryPlugin$3: can't find referenced class com.flurry.android.FlurryAgent
Warning:com.prime31.FlurryPlugin: can't find referenced class com.flurry.android.FlurryAdType
Warning:com.prime31.FlurryPlugin$4: can't find referenced class com.flurry.android.FlurryAgent
Warning:com.amazon.device.iap.internal.b.b: can't find referenced class com.amazon.android.framework.prompt.PromptContent
Warning:com.prime31.FlurryPlugin: can't find referenced class com.flurry.android.FlurryAds
Warning:com.amazon.device.iap.internal.b.b.a: can't find referenced class com.amazon.android.framework.task.pipeline.TaskPipelineId
Warning:com.amazon.device.iap.internal.b.i: can't find referenced class com.amazon.android.framework.prompt.PromptContent
Warning:com.freshdeskplugin.freshdesksupport.UnitySupport: can't find referenced class com.freshdesk.mobihelp.FeedbackType
Warning:com.amazon.device.iap.internal.b.i: can't find referenced class com.amazon.venezia.command.SuccessResult
Warning:com.amazon.device.iap.internal.b.i: can't find referenced class com.amazon.venezia.command.SuccessResult
Warning:com.amazon.device.iap.internal.b.i: can't find referenced class com.amazon.android.framework.task.command.AbstractCommandTask
Warning:com.amazon.device.iap.internal.b.b: can't find superclass or interface com.amazon.android.framework.prompt.SimplePrompt
Warning:com.amazon.device.iap.internal.b.b.a: can't find referenced class com.amazon.android.framework.resource.Resource
Warning:com.prime31.FlurryPlugin$8: can't find referenced class com.flurry.android.FlurryAds
Warning:com.freshdeskplugin.freshdesksupport.UnitySupport$1: can't find referenced class com.freshdesk.mobihelp.UnreadUpdatesCallback
Warning:com.amazon.device.iap.internal.b.b.a$1: can't find referenced class com.amazon.android.framework.context.ContextManager
Warning:com.amazon.device.iap.internal.b.d.b: can't find referenced class com.amazon.android.framework.exception.KiwiException
Warning:com.amazon.device.iap.internal.b.i: can't find referenced class com.amazon.android.framework.prompt.PromptContent
Warning:com.amazon.device.iap.internal.b.c.a: can't find referenced class com.amazon.android.framework.exception.KiwiException
Warning:com.amazon.device.iap.internal.b.i: can't find referenced class com.amazon.android.framework.prompt.PromptManager
Warning:com.amazon.device.iap.internal.b.d.b: can't find referenced method 'void preExecution()' in program class com.amazon.device.iap.internal.b.i
Warning:there were 214 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.
Warning:there were 2 unresolved references to program class members.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)
You may need to recompile the code.
Your input classes appear to be inconsistent.
Warning:there were 4 unresolved references to library class members.
You probably need to update the library versions.
Warning:Exception while processing task java.io.IOException: Please correct the above warnings first.
:starChef:transformClassesAndResourcesWithProguardForRelease FAILED
Normally Amazon suggests including the following in your ProGuard configuration file:
-dontwarn com.amazon.**
-keep class com.amazon.** {*;}
-keepattributes *Annotation*
and also skipping ProGuard's optimization:
-dontoptimize
However, in my personal experience, including suggestions from numerous other SO posts, none of that worked. In the end I had to turn off obfuscation (minifyEnabled false) to build for Amazon, which produced the release build:
android {
...
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
}
You may also want to experiment by adding this to your ProGuard settings:
-dontshrink
-keep class org.apache.** {*;}
-keepclasseswithmembernames class * {
native <methods>;
}
May be you are mismatching between
sdk version
Build Tools
Gradle Plugins
in terms of compatibility.
To resolve it, verify that you are using the latest versions of them. The gradle plugins are placed in the build.gradle of the project, and the other versions are on the build.gradle of the module.
For example, for SDK 23, you can use the Build Tools 23.0.1 and gradle plugins version 1.3.1.
clean it after change settings.
If you have several modules in your project, try to add
-dontwarn com.amazon.**
-keep class com.amazon.** {*;}
-keepattributes *Annotation*
-dontoptimize
to each proguard-rules.pro file in these modules.
For example, if you have two modules: base and installed, add the lines to both files:
base/proguard-rules.pro
installed/proguard-rules.pro

How to resolve following error while exporting APK in release mode?

: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.

Categories

Resources